From 449ab399f45da3a5310ef6d07865c923cc1eb269 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 21 Jan 2011 09:35:30 +0100 Subject: [PATCH] * nsterm.m (keyDown): If ns_right_alternate_modifier is Qleft, check if ns_alternate_modifier is none. --- src/ChangeLog | 5 +++++ src/nsterm.m | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c0424f9547..11a80ec3b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-21 Jan Djärv + + * nsterm.m (keyDown): If ns_right_alternate_modifier is Qleft, check + if ns_alternate_modifier is none. + 2011-01-20 Jan Djärv * unexmacosx.c: Add comment about include order. diff --git a/src/nsterm.m b/src/nsterm.m index 34841387d3..0838674de2 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4388,6 +4388,7 @@ ns_term_shutdown (int sig) int flags; static NSMutableArray *nsEvArray; static BOOL firstTime = YES; + int left_is_none; NSTRACE (keyDown); @@ -4511,10 +4512,14 @@ ns_term_shutdown (int sig) emacs_event->modifiers |= parse_solitary_modifier (ns_function_modifier); + left_is_none = NILP (ns_alternate_modifier) + || EQ (ns_alternate_modifier, Qnone); + if ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask) { if ((NILP (ns_right_alternate_modifier) - || EQ (ns_right_alternate_modifier, Qnone)) + || EQ (ns_right_alternate_modifier, Qnone) + || (EQ (ns_right_alternate_modifier, Qleft) && left_is_none)) && !fnKeysym) { /* accept pre-interp alt comb */ if ([[theEvent characters] length] > 0) @@ -4532,9 +4537,7 @@ ns_term_shutdown (int sig) if ((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) /* default = meta */ { - if ((NILP (ns_alternate_modifier) - || EQ (ns_alternate_modifier, Qnone)) - && !fnKeysym) + if (left_is_none && !fnKeysym) { /* accept pre-interp alt comb */ if ([[theEvent characters] length] > 0) code = [[theEvent characters] characterAtIndex: 0]; -- 2.20.1