aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2012-07-16 13:02:09 +0200
committerJan Djärv2012-07-16 13:02:09 +0200
commit5d127af98d11f54f9c75e28dcd8c3e26e42d50a8 (patch)
tree76ae291e9a21231de1544bb21ef8228cbec85a71 /src
parent01795a1bcf1ff334e4865d50e4dc3aea8c6b6b6e (diff)
downloademacs-5d127af98d11f54f9c75e28dcd8c3e26e42d50a8.tar.gz
emacs-5d127af98d11f54f9c75e28dcd8c3e26e42d50a8.zip
* nsterm.m (keyDown): Interpret flags without left/right bits
as the left key. Fixes: debbugs:11670
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/nsterm.m31
2 files changed, 30 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 44001546570..6c994369610 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsterm.m (keyDown): Interpret flags without left/right bits
4 as the left key (Bug#11670).
5
12012-07-16 Dmitry Antipov <dmantipov@yandex.ru> 62012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2 7
3 Remove empty and useless init functions. 8 Remove empty and useless init functions.
diff --git a/src/nsterm.m b/src/nsterm.m
index ff978d89d0e..c13fb6623f5 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4720,8 +4720,13 @@ ns_term_shutdown (int sig)
4720 4720
4721 if (!processingCompose) 4721 if (!processingCompose)
4722 { 4722 {
4723 /* When using screen sharing, no left or right information is sent,
4724 so use Left key in those cases. */
4725 int is_left_key, is_right_key;
4726
4723 code = ([[theEvent charactersIgnoringModifiers] length] == 0) ? 4727 code = ([[theEvent charactersIgnoringModifiers] length] == 0) ?
4724 0 : [[theEvent charactersIgnoringModifiers] characterAtIndex: 0]; 4728 0 : [[theEvent charactersIgnoringModifiers] characterAtIndex: 0];
4729
4725 /* (Carbon way: [theEvent keyCode]) */ 4730 /* (Carbon way: [theEvent keyCode]) */
4726 4731
4727 /* is it a "function key"? */ 4732 /* is it a "function key"? */
@@ -4746,13 +4751,17 @@ ns_term_shutdown (int sig)
4746 if (flags & NSShiftKeyMask) 4751 if (flags & NSShiftKeyMask)
4747 emacs_event->modifiers |= shift_modifier; 4752 emacs_event->modifiers |= shift_modifier;
4748 4753
4749 if ((flags & NSRightCommandKeyMask) == NSRightCommandKeyMask) 4754 is_right_key = (flags & NSRightCommandKeyMask) == NSRightCommandKeyMask;
4755 is_left_key = (flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask
4756 || (! is_right_key && (flags & NSCommandKeyMask) == NSCommandKeyMask);
4757
4758 if (is_right_key)
4750 emacs_event->modifiers |= parse_solitary_modifier 4759 emacs_event->modifiers |= parse_solitary_modifier
4751 (EQ (ns_right_command_modifier, Qleft) 4760 (EQ (ns_right_command_modifier, Qleft)
4752 ? ns_command_modifier 4761 ? ns_command_modifier
4753 : ns_right_command_modifier); 4762 : ns_right_command_modifier);
4754 4763
4755 if ((flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask) 4764 if (is_left_key)
4756 { 4765 {
4757 emacs_event->modifiers |= parse_solitary_modifier 4766 emacs_event->modifiers |= parse_solitary_modifier
4758 (ns_command_modifier); 4767 (ns_command_modifier);
@@ -4789,13 +4798,17 @@ ns_term_shutdown (int sig)
4789 } 4798 }
4790 } 4799 }
4791 4800
4792 if ((flags & NSRightControlKeyMask) == NSRightControlKeyMask) 4801 is_right_key = (flags & NSRightControlKeyMask) == NSRightControlKeyMask;
4802 is_left_key = (flags & NSLeftControlKeyMask) == NSLeftControlKeyMask
4803 || (! is_right_key && (flags & NSControlKeyMask) == NSControlKeyMask);
4804
4805 if (is_right_key)
4793 emacs_event->modifiers |= parse_solitary_modifier 4806 emacs_event->modifiers |= parse_solitary_modifier
4794 (EQ (ns_right_control_modifier, Qleft) 4807 (EQ (ns_right_control_modifier, Qleft)
4795 ? ns_control_modifier 4808 ? ns_control_modifier
4796 : ns_right_control_modifier); 4809 : ns_right_control_modifier);
4797 4810
4798 if ((flags & NSLeftControlKeyMask) == NSLeftControlKeyMask) 4811 if (is_left_key)
4799 emacs_event->modifiers |= parse_solitary_modifier 4812 emacs_event->modifiers |= parse_solitary_modifier
4800 (ns_control_modifier); 4813 (ns_control_modifier);
4801 4814
@@ -4806,7 +4819,13 @@ ns_term_shutdown (int sig)
4806 left_is_none = NILP (ns_alternate_modifier) 4819 left_is_none = NILP (ns_alternate_modifier)
4807 || EQ (ns_alternate_modifier, Qnone); 4820 || EQ (ns_alternate_modifier, Qnone);
4808 4821
4809 if ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask) 4822 is_right_key = (flags & NSRightAlternateKeyMask)
4823 == NSRightAlternateKeyMask;
4824 is_left_key = (flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask
4825 || (! is_right_key
4826 && (flags & NSAlternateKeyMask) == NSAlternateKeyMask);
4827
4828 if (is_right_key)
4810 { 4829 {
4811 if ((NILP (ns_right_alternate_modifier) 4830 if ((NILP (ns_right_alternate_modifier)
4812 || EQ (ns_right_alternate_modifier, Qnone) 4831 || EQ (ns_right_alternate_modifier, Qnone)
@@ -4826,7 +4845,7 @@ ns_term_shutdown (int sig)
4826 : ns_right_alternate_modifier); 4845 : ns_right_alternate_modifier);
4827 } 4846 }
4828 4847
4829 if ((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) /* default = meta */ 4848 if (is_left_key) /* default = meta */
4830 { 4849 {
4831 if (left_is_none && !fnKeysym) 4850 if (left_is_none && !fnKeysym)
4832 { /* accept pre-interp alt comb */ 4851 { /* accept pre-interp alt comb */