diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-05-26 17:12:04 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-05-26 17:12:04 +0000 |
| commit | c82820e55b5f1afe487ffd027e54e0d1b6c554ca (patch) | |
| tree | 6d94f25532e1f4bb75c4fe139c110f2feedfa107 /osx.m | |
| parent | a0f376efbd50f16694d4c533d4b2836cfbd48d2c (diff) | |
| download | puzzles-c82820e55b5f1afe487ffd027e54e0d1b6c554ca.zip puzzles-c82820e55b5f1afe487ffd027e54e0d1b6c554ca.tar.gz puzzles-c82820e55b5f1afe487ffd027e54e0d1b6c554ca.tar.bz2 puzzles-c82820e55b5f1afe487ffd027e54e0d1b6c554ca.tar.xz | |
Add support for Jacob's new cursor-key modifier flags in the OS X frontend.
[originally from svn r5847]
Diffstat (limited to 'osx.m')
| -rw-r--r-- | osx.m | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -589,22 +589,34 @@ struct frontend { * function key codes. */ if (c >= 0x80) { + int mods = FALSE; switch (c) { case NSUpArrowFunctionKey: c = CURSOR_UP; + mods = TRUE; break; case NSDownArrowFunctionKey: c = CURSOR_DOWN; + mods = TRUE; break; case NSLeftArrowFunctionKey: c = CURSOR_LEFT; + mods = TRUE; break; case NSRightArrowFunctionKey: c = CURSOR_RIGHT; + mods = TRUE; break; default: continue; } + + if (mods) { + if ([ev modifierFlags] & NSShiftKeyMask) + c |= MOD_SHFT; + if ([ev modifierFlags] & NSControlKeyMask) + c |= MOD_CTRL; + } } if (c >= '0' && c <= '9' && ([ev modifierFlags] & NSNumericPadKeyMask)) |