230 |
|
|
231 |
extern int extra_keyboard_modifiers; |
extern int extra_keyboard_modifiers; |
232 |
|
|
233 |
|
/* The keysyms to use for the various modifiers. */ |
234 |
|
|
235 |
|
static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value; |
236 |
|
|
237 |
static Lisp_Object Qvendor_specific_keysyms; |
static Lisp_Object Qvendor_specific_keysyms; |
238 |
|
|
239 |
#if 0 |
#if 0 |
7018 |
/* True if using command key as meta key. */ |
/* True if using command key as meta key. */ |
7019 |
Lisp_Object Vmac_command_key_is_meta; |
Lisp_Object Vmac_command_key_is_meta; |
7020 |
|
|
7021 |
|
/* Modifier associated with the option key, or nil for normal behavior. */ |
7022 |
|
Lisp_Object Vmac_option_modifier; |
7023 |
|
|
7024 |
/* True if the ctrl and meta keys should be reversed. */ |
/* True if the ctrl and meta keys should be reversed. */ |
7025 |
Lisp_Object Vmac_reverse_ctrl_meta; |
Lisp_Object Vmac_reverse_ctrl_meta; |
7026 |
|
|
7102 |
result |= meta_modifier; |
result |= meta_modifier; |
7103 |
if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey)) |
if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey)) |
7104 |
result |= alt_modifier; |
result |= alt_modifier; |
7105 |
|
if (!NILP (Vmac_option_modifier) && (mods & optionKey)) { |
7106 |
|
Lisp_Object val = Fget(Vmac_option_modifier, Qmodifier_value); |
7107 |
|
if (!NILP(val)) |
7108 |
|
result |= XUINT(val); |
7109 |
|
} |
7110 |
|
|
7111 |
return result; |
return result; |
7112 |
} |
} |
7113 |
|
|
8588 |
unsigned long some_state = 0; |
unsigned long some_state = 0; |
8589 |
inev.code = KeyTranslate (kchr_ptr, new_keycode, |
inev.code = KeyTranslate (kchr_ptr, new_keycode, |
8590 |
&some_state) & 0xff; |
&some_state) & 0xff; |
8591 |
} |
} else if (!NILP(Vmac_option_modifier) && (er.modifiers & optionKey)) |
8592 |
|
{ |
8593 |
|
/* When using the option key as an emacs modifier, convert |
8594 |
|
the pressed key code back to one without the Mac option |
8595 |
|
modifier applied. */ |
8596 |
|
int new_modifiers = er.modifiers & ~optionKey; |
8597 |
|
int new_keycode = keycode | new_modifiers; |
8598 |
|
Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache); |
8599 |
|
unsigned long some_state = 0; |
8600 |
|
inev.code = KeyTranslate (kchr_ptr, new_keycode, |
8601 |
|
&some_state) & 0xff; |
8602 |
|
} |
8603 |
else |
else |
8604 |
inev.code = er.message & charCodeMask; |
inev.code = er.message & charCodeMask; |
8605 |
inev.kind = ASCII_KEYSTROKE_EVENT; |
inev.kind = ASCII_KEYSTROKE_EVENT; |
9298 |
x_error_message_string = Qnil; |
x_error_message_string = Qnil; |
9299 |
#endif |
#endif |
9300 |
|
|
9301 |
|
Qmodifier_value = intern ("modifier-value"); |
9302 |
|
Qalt = intern ("alt"); |
9303 |
|
Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); |
9304 |
|
Qhyper = intern ("hyper"); |
9305 |
|
Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier)); |
9306 |
|
Qsuper = intern ("super"); |
9307 |
|
Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); |
9308 |
|
|
9309 |
Fprovide (intern ("mac-carbon"), Qnil); |
Fprovide (intern ("mac-carbon"), Qnil); |
9310 |
|
|
9311 |
staticpro (&Qreverse); |
staticpro (&Qreverse); |
9362 |
Otherwise the option key is used. */); |
Otherwise the option key is used. */); |
9363 |
Vmac_command_key_is_meta = Qt; |
Vmac_command_key_is_meta = Qt; |
9364 |
|
|
9365 |
|
DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier, |
9366 |
|
doc: /* Modifier to use for the Mac alt/option key. The value can |
9367 |
|
be alt, hyper, or super for the respective modifier. If the value is |
9368 |
|
nil then the key will act as the normal Mac option modifier. */); |
9369 |
|
Vmac_option_modifier = Qnil; |
9370 |
|
|
9371 |
DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta, |
DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta, |
9372 |
doc: /* Non-nil means that the control and meta keys are reversed. This is |
doc: /* Non-nil means that the control and meta keys are reversed. This is |
9373 |
useful for non-standard keyboard layouts. */); |
useful for non-standard keyboard layouts. */); |