mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Add support for Jacob's new cursor-key modifier flags in the OS X frontend.
[originally from svn r5847]
This commit is contained in:
12
osx.m
12
osx.m
@ -589,22 +589,34 @@ struct frontend {
|
|||||||
* function key codes.
|
* function key codes.
|
||||||
*/
|
*/
|
||||||
if (c >= 0x80) {
|
if (c >= 0x80) {
|
||||||
|
int mods = FALSE;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case NSUpArrowFunctionKey:
|
case NSUpArrowFunctionKey:
|
||||||
c = CURSOR_UP;
|
c = CURSOR_UP;
|
||||||
|
mods = TRUE;
|
||||||
break;
|
break;
|
||||||
case NSDownArrowFunctionKey:
|
case NSDownArrowFunctionKey:
|
||||||
c = CURSOR_DOWN;
|
c = CURSOR_DOWN;
|
||||||
|
mods = TRUE;
|
||||||
break;
|
break;
|
||||||
case NSLeftArrowFunctionKey:
|
case NSLeftArrowFunctionKey:
|
||||||
c = CURSOR_LEFT;
|
c = CURSOR_LEFT;
|
||||||
|
mods = TRUE;
|
||||||
break;
|
break;
|
||||||
case NSRightArrowFunctionKey:
|
case NSRightArrowFunctionKey:
|
||||||
c = CURSOR_RIGHT;
|
c = CURSOR_RIGHT;
|
||||||
|
mods = TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
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))
|
if (c >= '0' && c <= '9' && ([ev modifierFlags] & NSNumericPadKeyMask))
|
||||||
|
Reference in New Issue
Block a user