emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110793: * nsterm.m: Add NSClearLineF


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110793: * nsterm.m: Add NSClearLineFunctionKey and keypad keys.
Date: Sun, 04 Nov 2012 11:34:10 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110793
fixes bug: http://debbugs.gnu.org/8680
author: Michael Marchionna <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2012-11-04 11:34:10 +0800
message:
  * nsterm.m: Add NSClearLineFunctionKey and keypad keys.
  (keyDown): Remap keypad keys to X11 virtual key codes.
modified:
  src/ChangeLog
  src/nsterm.m
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-11-03 20:48:03 +0000
+++ b/src/ChangeLog     2012-11-04 03:34:10 +0000
@@ -1,3 +1,8 @@
+2012-11-04  Michael Marchionna  <address@hidden>
+
+       * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
+       (keyDown): Remap keypad keys to X11 virtual key codes.
+
 2012-11-03  Paul Eggert  <address@hidden>
 
        Fix data-loss with --batch (Bug#9574).

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2012-10-28 16:10:06 +0000
+++ b/src/nsterm.m      2012-11-04 03:34:10 +0000
@@ -100,6 +100,7 @@
   NSBeginFunctionKey,           0x58,
   NSSelectFunctionKey,          0x60,
   NSPrintFunctionKey,           0x61,
+  NSClearLineFunctionKey,       0x0B,
   NSExecuteFunctionKey,         0x62,
   NSInsertFunctionKey,          0x63,
   NSUndoFunctionKey,            0x65,
@@ -144,6 +145,23 @@
   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 @@
   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 @@
       /* (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 @@
 
       /* are there modifiers? */
       emacs_event->modifiers = 0;
-      flags = [theEvent modifierFlags];
 
       if (flags & NSHelpKeyMask)
           emacs_event->modifiers |= hyper_modifier;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]