Add support for Jacob's new cursor-key modifier flags in the OS X frontend.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 26 May 2005 17:12:04 +0000 (17:12 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 26 May 2005 17:12:04 +0000 (17:12 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@5847 cda61777-01e9-0310-a592-d414129be87e

osx.m

diff --git a/osx.m b/osx.m
index dfed94c..ed33bf6 100644 (file)
--- a/osx.m
+++ b/osx.m
@@ -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))