diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/nsterm.m | 32 |
2 files changed, 39 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d63f417ed42..9ce5007d3b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2010-10-10 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 | |||
| 1 | 2010-10-08 Michael Albinus <michael.albinus@gmx.de> | 12 | 2010-10-08 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 13 | ||
| 3 | * dbusbind.c (xd_get_dispatch_status): Return a Lisp_Object. | 14 | * dbusbind.c (xd_get_dispatch_status): Return a Lisp_Object. |
diff --git a/src/nsterm.m b/src/nsterm.m index 7c70b2ae698..fc933c099e8 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -142,13 +142,18 @@ Lisp_Object ns_input_spi_name, ns_input_spi_arg; | |||
| 142 | Lisp_Object Vx_toolkit_scroll_bars; | 142 | Lisp_Object Vx_toolkit_scroll_bars; |
| 143 | static Lisp_Object Qmodifier_value; | 143 | static Lisp_Object Qmodifier_value; |
| 144 | Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper, Qnone; | 144 | Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper, Qnone; |
| 145 | extern Lisp_Object Qcursor_color, Qcursor_type, Qns; | 145 | extern 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. */ |
| 149 | Lisp_Object ns_alternate_modifier; | 149 | Lisp_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. */ | ||
| 154 | Lisp_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. */ |
| 153 | Lisp_Object ns_command_modifier; | 158 | Lisp_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) \ |
| @@ -4423,7 +4433,13 @@ ns_term_shutdown (int sig) | |||
| 4423 | emacs_event->modifiers |= | 4433 | emacs_event->modifiers |= |
| 4424 | parse_solitary_modifier (ns_function_modifier); | 4434 | parse_solitary_modifier (ns_function_modifier); |
| 4425 | 4435 | ||
| 4426 | if (flags & NSAlternateKeyMask) /* default = meta */ | 4436 | if (!EQ (ns_right_alternate_modifier, Qleft) |
| 4437 | && ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask)) | ||
| 4438 | { | ||
| 4439 | emacs_event->modifiers |= parse_solitary_modifier | ||
| 4440 | (ns_right_alternate_modifier); | ||
| 4441 | } | ||
| 4442 | else if (flags & NSAlternateKeyMask) /* default = meta */ | ||
| 4427 | { | 4443 | { |
| 4428 | if ((NILP (ns_alternate_modifier) || EQ (ns_alternate_modifier, Qnone)) | 4444 | if ((NILP (ns_alternate_modifier) || EQ (ns_alternate_modifier, Qnone)) |
| 4429 | && !fnKeysym) | 4445 | && !fnKeysym) |
| @@ -6185,6 +6201,14 @@ Set to none means that the alternate / option key is not interpreted by Emacs\n\ | |||
| 6185 | at all, allowing it to be used at a lower level for accented character entry."); | 6201 | at all, allowing it to be used at a lower level for accented character entry."); |
| 6186 | ns_alternate_modifier = Qmeta; | 6202 | ns_alternate_modifier = Qmeta; |
| 6187 | 6203 | ||
| 6204 | DEFVAR_LISP ("ns-right-alternate-modifier", &ns_right_alternate_modifier, | ||
| 6205 | "This variable describes the behavior of the right alternate or option key.\n\ | ||
| 6206 | Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\ | ||
| 6207 | Set to left means be the same key as `ns-alternate-modifier'.\n\ | ||
| 6208 | Set to none means that the alternate / option key is not interpreted by Emacs\n\ | ||
| 6209 | at all, allowing it to be used at a lower level for accented character entry."); | ||
| 6210 | ns_right_alternate_modifier = Qleft; | ||
| 6211 | |||
| 6188 | DEFVAR_LISP ("ns-command-modifier", &ns_command_modifier, | 6212 | DEFVAR_LISP ("ns-command-modifier", &ns_command_modifier, |
| 6189 | "This variable describes the behavior of the command key.\n\ | 6213 | "This variable describes the behavior of the command key.\n\ |
| 6190 | Set to control, meta, alt, super, or hyper means it is taken to be that key."); | 6214 | Set to control, meta, alt, super, or hyper means it is taken to be that key."); |