Commit 8f31e74b authored by Michael Marchionna's avatar Michael Marchionna Committed by Chong Yidong
Browse files

* nsterm.m: Add NSClearLineFunctionKey and keypad keys.

(keyDown): Remap keypad keys to X11 virtual key codes.

Fixes: debbugs:8680
parent 2cbafa56
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).
......
......@@ -100,6 +100,7 @@ Updated by Christian Limpach (chris@nice.ch)
NSBeginFunctionKey, 0x58,
NSSelectFunctionKey, 0x60,
NSPrintFunctionKey, 0x61,
NSClearLineFunctionKey, 0x0B,
NSExecuteFunctionKey, 0x62,
NSInsertFunctionKey, 0x63,
NSUndoFunctionKey, 0x65,
......@@ -144,6 +145,23 @@ Updated by Christian Limpach (chris@nice.ch)
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 @@ - (void)keyDown: (NSEvent *)theEvent
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 @@ most recently updated (I guess), which is not the correct one. */
/* (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 @@ most recently updated (I guess), which is not the correct one. */
/* are there modifiers? */
emacs_event->modifiers = 0;
flags = [theEvent modifierFlags];
if (flags & NSHelpKeyMask)
emacs_event->modifiers |= hyper_modifier;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment