]> git.eshelyaron.com Git - emacs.git/commitdiff
* nsterm.m: Add NSClearLineFunctionKey and keypad keys.
authorMichael Marchionna <tralfaz@pacbell.net>
Sun, 4 Nov 2012 03:34:10 +0000 (11:34 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 4 Nov 2012 03:34:10 +0000 (11:34 +0800)
(keyDown): Remap keypad keys to X11 virtual key codes.

Fixes: debbugs:8680
src/ChangeLog
src/nsterm.m

index e2d86b75e5706d35052dc27fba729ffd31b56345..b30b21634359d106724abf3bb7fbc46dc4c2e216 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-04  Michael Marchionna  <tralfaz@pacbell.net>
+
+       * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
+       (keyDown): Remap keypad keys to X11 virtual key codes.
+
 2012-11-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix data-loss with --batch (Bug#9574).
index 9b2e544c75baa8a9f0c9bc02f9e3e951cfa01f7c..e46212478547e4c359923bec0bc5118cf184c16f 100644 (file)
@@ -100,6 +100,7 @@ static unsigned convert_ns_to_X_keysym[] =
   NSBeginFunctionKey,           0x58,
   NSSelectFunctionKey,          0x60,
   NSPrintFunctionKey,           0x61,
+  NSClearLineFunctionKey,       0x0B,
   NSExecuteFunctionKey,         0x62,
   NSInsertFunctionKey,          0x63,
   NSUndoFunctionKey,            0x65,
@@ -144,6 +145,23 @@ static unsigned convert_ns_to_X_keysym[] =
   NSNewlineCharacter,          0x0D,
   NSEnterCharacter,            0x8D,
 
+  0x41,                         0xAE,  /* KP_Decimal */
+  0x43,                         0xAA,  /* KP_Multiply */
+  0x45,                         0xAB,  /* KP_Add */
+  0x4B,                         0xAF,  /* KP_Divide */
+  0x4E,                         0xAD,  /* KP_Subtract */
+  0x51,                         0xBD,  /* KP_Equal */
+  0x52,                         0xB0,  /* KP_0 */
+  0x53,                         0xB1,  /* KP_1 */
+  0x54,                         0xB2,  /* KP_2 */
+  0x55,                         0xB3,  /* KP_3 */
+  0x56,                         0xB4,  /* KP_4 */
+  0x57,                         0xB5,  /* KP_5 */
+  0x58,                         0xB6,  /* KP_6 */
+  0x59,                         0xB7,  /* KP_7 */
+  0x5B,                         0xB8,  /* KP_8 */
+  0x5C,                         0xB9,  /* KP_9 */
+
   0x1B,                                0x1B   /* escape */
 };
 
@@ -4754,12 +4772,12 @@ not_in_argv (NSString *arg)
   Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe);
   int code;
   unsigned fnKeysym = 0;
-  int flags;
   static NSMutableArray *nsEvArray;
 #if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
   static BOOL firstTime = YES;
 #endif
   int left_is_none;
+  unsigned int flags = [theEvent modifierFlags];
 
   NSTRACE (keyDown);
 
@@ -4810,7 +4828,10 @@ not_in_argv (NSString *arg)
       /* (Carbon way: [theEvent keyCode]) */
 
       /* is it a "function key"? */
-      fnKeysym = ns_convert_key (code);
+      fnKeysym = (code < 0x00ff && (flags&NSNumericPadKeyMask))
+       ? ns_convert_key ([theEvent keyCode])
+       : ns_convert_key (code);
+
       if (fnKeysym)
         {
           /* COUNTERHACK: map 'Delete' on upper-right main KB to 'Backspace',
@@ -4823,7 +4844,6 @@ not_in_argv (NSString *arg)
 
       /* are there modifiers? */
       emacs_event->modifiers = 0;
-      flags = [theEvent modifierFlags];
 
       if (flags & NSHelpKeyMask)
           emacs_event->modifiers |= hyper_modifier;