aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2010-10-12 01:57:49 +0200
committerJuanma Barranquero2010-10-12 01:57:49 +0200
commit4c14013dbec3a2f130a38e61e885f1e8cc6c325b (patch)
treeb74121c8de587c217f0d146752e8893d0874aae7 /src
parentf0b7f5a884806112b6a938b9c31607ea005431d3 (diff)
parenta2e35ef5d52031e0fa184d1863fe7cb7043ef637 (diff)
downloademacs-4c14013dbec3a2f130a38e61e885f1e8cc6c325b.tar.gz
emacs-4c14013dbec3a2f130a38e61e885f1e8cc6c325b.zip
Merge changes from emacs-23 branch.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/nsterm.m32
2 files changed, 39 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1c75c758498..da1ce968b62 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12010-10-12 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsterm.m (Qleft): Declare.
4 (ns_right_alternate_modifier): New variable
5 (NSRightAlternateKeyMask): New define.
6 (EV_MODIFIERS): Parse NSRightAlternateKeyMask if
7 ns_right_alternate_modifier isn't Qleft.
8 (keyDown): If ns_right_alternate_modifier isn't Qleft, use it
9 as emacs modifier for NSRightAlternateKeyMask.
10 (syms_of_nsterm): DEFVAR_LISP ns-right-alternate-modifier.
11
12010-10-10 Lars Magne Ingebrigtsen <larsi@gnus.org> 122010-10-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 13
3 * gnutls.c (emacs_gnutls_write): If we're trying to write before 14 * gnutls.c (emacs_gnutls_write): If we're trying to write before
diff --git a/src/nsterm.m b/src/nsterm.m
index f0efb948ab9..3c146c5d2a6 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -142,13 +142,18 @@ Lisp_Object ns_input_spi_name, ns_input_spi_arg;
142Lisp_Object Vx_toolkit_scroll_bars; 142Lisp_Object Vx_toolkit_scroll_bars;
143static Lisp_Object Qmodifier_value; 143static Lisp_Object Qmodifier_value;
144Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper, Qnone; 144Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper, Qnone;
145extern Lisp_Object Qcursor_color, Qcursor_type, Qns; 145extern Lisp_Object Qcursor_color, Qcursor_type, Qns, Qleft;
146 146
147/* Specifies which emacs modifier should be generated when NS receives 147/* Specifies which emacs modifier should be generated when NS receives
148 the Alternate modifer. May be Qnone or any of the modifier lisp symbols. */ 148 the Alternate modifer. May be Qnone or any of the modifier lisp symbols. */
149Lisp_Object ns_alternate_modifier; 149Lisp_Object ns_alternate_modifier;
150 150
151/* Specifies which emacs modifier should be generated when NS receives 151/* Specifies which emacs modifier should be generated when NS receives
152 the right Alternate modifer. Has same values as ns_alternate_modifier plus
153 the value Qleft which means whatever value ns_alternate_modifier has. */
154Lisp_Object ns_right_alternate_modifier;
155
156/* Specifies which emacs modifier should be generated when NS receives
152 the Command modifer. May be any of the modifier lisp symbols. */ 157 the Command modifer. May be any of the modifier lisp symbols. */
153Lisp_Object ns_command_modifier; 158Lisp_Object ns_command_modifier;
154 159
@@ -218,12 +223,17 @@ static BOOL inNsSelect = 0;
218 223
219/* Convert modifiers in a NeXTSTEP event to emacs style modifiers. */ 224/* Convert modifiers in a NeXTSTEP event to emacs style modifiers. */
220#define NS_FUNCTION_KEY_MASK 0x800000 225#define NS_FUNCTION_KEY_MASK 0x800000
226#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
221#define EV_MODIFIERS(e) \ 227#define EV_MODIFIERS(e) \
222 ((([e modifierFlags] & NSHelpKeyMask) ? \ 228 ((([e modifierFlags] & NSHelpKeyMask) ? \
223 hyper_modifier : 0) \ 229 hyper_modifier : 0) \
224 | (([e modifierFlags] & NSAlternateKeyMask) ? \ 230 | (!EQ (ns_right_alternate_modifier, Qleft) && \
231 (([e modifierFlags] & NSRightAlternateKeyMask) \
232 == NSRightAlternateKeyMask) ? \
233 parse_solitary_modifier (ns_right_alternate_modifier) : 0) \
234 | (([e modifierFlags] & NSAlternateKeyMask) ? \
225 parse_solitary_modifier (ns_alternate_modifier) : 0) \ 235 parse_solitary_modifier (ns_alternate_modifier) : 0) \
226 | (([e modifierFlags] & NSShiftKeyMask) ? \ 236 | (([e modifierFlags] & NSShiftKeyMask) ? \
227 shift_modifier : 0) \ 237 shift_modifier : 0) \
228 | (([e modifierFlags] & NSControlKeyMask) ? \ 238 | (([e modifierFlags] & NSControlKeyMask) ? \
229 parse_solitary_modifier (ns_control_modifier) : 0) \ 239 parse_solitary_modifier (ns_control_modifier) : 0) \
@@ -4440,7 +4450,13 @@ ns_term_shutdown (int sig)
4440 emacs_event->modifiers |= 4450 emacs_event->modifiers |=
4441 parse_solitary_modifier (ns_function_modifier); 4451 parse_solitary_modifier (ns_function_modifier);
4442 4452
4443 if (flags & NSAlternateKeyMask) /* default = meta */ 4453 if (!EQ (ns_right_alternate_modifier, Qleft)
4454 && ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask))
4455 {
4456 emacs_event->modifiers |= parse_solitary_modifier
4457 (ns_right_alternate_modifier);
4458 }
4459 else if (flags & NSAlternateKeyMask) /* default = meta */
4444 { 4460 {
4445 if ((NILP (ns_alternate_modifier) || EQ (ns_alternate_modifier, Qnone)) 4461 if ((NILP (ns_alternate_modifier) || EQ (ns_alternate_modifier, Qnone))
4446 && !fnKeysym) 4462 && !fnKeysym)
@@ -6203,6 +6219,14 @@ Set to none means that the alternate / option key is not interpreted by Emacs\n\
6203at all, allowing it to be used at a lower level for accented character entry."); 6219at all, allowing it to be used at a lower level for accented character entry.");
6204 ns_alternate_modifier = Qmeta; 6220 ns_alternate_modifier = Qmeta;
6205 6221
6222 DEFVAR_LISP ("ns-right-alternate-modifier", &ns_right_alternate_modifier,
6223 "This variable describes the behavior of the right alternate or option key.\n\
6224Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
6225Set to left means be the same key as `ns-alternate-modifier'.\n\
6226Set to none means that the alternate / option key is not interpreted by Emacs\n\
6227at all, allowing it to be used at a lower level for accented character entry.");
6228 ns_right_alternate_modifier = Qleft;
6229
6206 DEFVAR_LISP ("ns-command-modifier", &ns_command_modifier, 6230 DEFVAR_LISP ("ns-command-modifier", &ns_command_modifier,
6207 "This variable describes the behavior of the command key.\n\ 6231 "This variable describes the behavior of the command key.\n\
6208Set to control, meta, alt, super, or hyper means it is taken to be that key."); 6232Set to control, meta, alt, super, or hyper means it is taken to be that key.");