Mercurial > emacs
comparison src/nsterm.m @ 112395:f1de024f822c
* nsterm.m (keyDown): If ns_right_alternate_modifier is Qleft, check
if ns_alternate_modifier is none.
author | Jan D. <jan.h.d@swipnet.se> |
---|---|
date | Fri, 21 Jan 2011 09:35:30 +0100 |
parents | 7935463f385e |
children | e79e716435f4 |
comparison
equal
deleted
inserted
replaced
112394:23a54fb18e67 | 112395:f1de024f822c |
---|---|
4386 int code; | 4386 int code; |
4387 unsigned fnKeysym = 0; | 4387 unsigned fnKeysym = 0; |
4388 int flags; | 4388 int flags; |
4389 static NSMutableArray *nsEvArray; | 4389 static NSMutableArray *nsEvArray; |
4390 static BOOL firstTime = YES; | 4390 static BOOL firstTime = YES; |
4391 int left_is_none; | |
4391 | 4392 |
4392 NSTRACE (keyDown); | 4393 NSTRACE (keyDown); |
4393 | 4394 |
4394 /* Rhapsody and OS X give up and down events for the arrow keys */ | 4395 /* Rhapsody and OS X give up and down events for the arrow keys */ |
4395 if (ns_fake_keydown == YES) | 4396 if (ns_fake_keydown == YES) |
4509 | 4510 |
4510 if (flags & NS_FUNCTION_KEY_MASK && !fnKeysym) | 4511 if (flags & NS_FUNCTION_KEY_MASK && !fnKeysym) |
4511 emacs_event->modifiers |= | 4512 emacs_event->modifiers |= |
4512 parse_solitary_modifier (ns_function_modifier); | 4513 parse_solitary_modifier (ns_function_modifier); |
4513 | 4514 |
4515 left_is_none = NILP (ns_alternate_modifier) | |
4516 || EQ (ns_alternate_modifier, Qnone); | |
4517 | |
4514 if ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask) | 4518 if ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask) |
4515 { | 4519 { |
4516 if ((NILP (ns_right_alternate_modifier) | 4520 if ((NILP (ns_right_alternate_modifier) |
4517 || EQ (ns_right_alternate_modifier, Qnone)) | 4521 || EQ (ns_right_alternate_modifier, Qnone) |
4522 || (EQ (ns_right_alternate_modifier, Qleft) && left_is_none)) | |
4518 && !fnKeysym) | 4523 && !fnKeysym) |
4519 { /* accept pre-interp alt comb */ | 4524 { /* accept pre-interp alt comb */ |
4520 if ([[theEvent characters] length] > 0) | 4525 if ([[theEvent characters] length] > 0) |
4521 code = [[theEvent characters] characterAtIndex: 0]; | 4526 code = [[theEvent characters] characterAtIndex: 0]; |
4522 /*HACK: clear lone shift modifier to stop next if from firing */ | 4527 /*HACK: clear lone shift modifier to stop next if from firing */ |
4530 : ns_right_alternate_modifier); | 4535 : ns_right_alternate_modifier); |
4531 } | 4536 } |
4532 | 4537 |
4533 if ((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) /* default = meta */ | 4538 if ((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) /* default = meta */ |
4534 { | 4539 { |
4535 if ((NILP (ns_alternate_modifier) | 4540 if (left_is_none && !fnKeysym) |
4536 || EQ (ns_alternate_modifier, Qnone)) | |
4537 && !fnKeysym) | |
4538 { /* accept pre-interp alt comb */ | 4541 { /* accept pre-interp alt comb */ |
4539 if ([[theEvent characters] length] > 0) | 4542 if ([[theEvent characters] length] > 0) |
4540 code = [[theEvent characters] characterAtIndex: 0]; | 4543 code = [[theEvent characters] characterAtIndex: 0]; |
4541 /*HACK: clear lone shift modifier to stop next if from firing */ | 4544 /*HACK: clear lone shift modifier to stop next if from firing */ |
4542 if (emacs_event->modifiers == shift_modifier) | 4545 if (emacs_event->modifiers == shift_modifier) |