228 |
|
|
229 |
extern int extra_keyboard_modifiers; |
extern int extra_keyboard_modifiers; |
230 |
|
|
231 |
|
/* The keysyms to use for the various modifiers. */ |
232 |
|
|
233 |
|
static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value; |
234 |
|
|
235 |
static Lisp_Object Qvendor_specific_keysyms; |
static Lisp_Object Qvendor_specific_keysyms; |
236 |
|
|
237 |
#if 0 |
#if 0 |
6992 |
/* True if using command key as meta key. */ |
/* True if using command key as meta key. */ |
6993 |
Lisp_Object Vmac_command_key_is_meta; |
Lisp_Object Vmac_command_key_is_meta; |
6994 |
|
|
6995 |
|
/* Modifier associated with the option key, or nil for normal behavior. */ |
6996 |
|
Lisp_Object Vmac_option_modifier; |
6997 |
|
|
6998 |
/* True if the ctrl and meta keys should be reversed. */ |
/* True if the ctrl and meta keys should be reversed. */ |
6999 |
Lisp_Object Vmac_reverse_ctrl_meta; |
Lisp_Object Vmac_reverse_ctrl_meta; |
7000 |
|
|
7076 |
result |= meta_modifier; |
result |= meta_modifier; |
7077 |
if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey)) |
if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey)) |
7078 |
result |= alt_modifier; |
result |= alt_modifier; |
7079 |
|
if (!NILP (Vmac_option_modifier) && (mods & optionKey)) { |
7080 |
|
Lisp_Object val = Fget(Vmac_option_modifier, Qmodifier_value); |
7081 |
|
if (!NILP(val)) |
7082 |
|
result |= XUINT(val); |
7083 |
|
} |
7084 |
|
|
7085 |
return result; |
return result; |
7086 |
} |
} |
7087 |
|
|
8562 |
unsigned long some_state = 0; |
unsigned long some_state = 0; |
8563 |
inev.code = KeyTranslate (kchr_ptr, new_keycode, |
inev.code = KeyTranslate (kchr_ptr, new_keycode, |
8564 |
&some_state) & 0xff; |
&some_state) & 0xff; |
8565 |
} |
} else if (!NILP(Vmac_option_modifier) && (er.modifiers & optionKey)) |
8566 |
|
{ |
8567 |
|
/* When using the option key as an emacs modifier, convert |
8568 |
|
the pressed key code back to one without the Mac option |
8569 |
|
modifier applied. */ |
8570 |
|
int new_modifiers = er.modifiers & ~optionKey; |
8571 |
|
int new_keycode = keycode | new_modifiers; |
8572 |
|
Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache); |
8573 |
|
unsigned long some_state = 0; |
8574 |
|
inev.code = KeyTranslate (kchr_ptr, new_keycode, |
8575 |
|
&some_state) & 0xff; |
8576 |
|
} |
8577 |
else |
else |
8578 |
inev.code = er.message & charCodeMask; |
inev.code = er.message & charCodeMask; |
8579 |
inev.kind = ASCII_KEYSTROKE_EVENT; |
inev.kind = ASCII_KEYSTROKE_EVENT; |
9272 |
x_error_message_string = Qnil; |
x_error_message_string = Qnil; |
9273 |
#endif |
#endif |
9274 |
|
|
9275 |
|
Qmodifier_value = intern ("modifier-value"); |
9276 |
|
Qalt = intern ("alt"); |
9277 |
|
Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); |
9278 |
|
Qhyper = intern ("hyper"); |
9279 |
|
Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier)); |
9280 |
|
Qsuper = intern ("super"); |
9281 |
|
Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); |
9282 |
|
|
9283 |
Fprovide (intern ("mac-carbon"), Qnil); |
Fprovide (intern ("mac-carbon"), Qnil); |
9284 |
|
|
9285 |
staticpro (&Qreverse); |
staticpro (&Qreverse); |
9336 |
Otherwise the option key is used. */); |
Otherwise the option key is used. */); |
9337 |
Vmac_command_key_is_meta = Qt; |
Vmac_command_key_is_meta = Qt; |
9338 |
|
|
9339 |
|
DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier, |
9340 |
|
doc: /* Modifier to use for the Mac alt/option key. The value can |
9341 |
|
be alt, hyper, or super for the respective modifier. If the value is |
9342 |
|
nil then the key will act as the normal Mac option modifier. */); |
9343 |
|
Vmac_option_modifier = Qnil; |
9344 |
|
|
9345 |
DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta, |
DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta, |
9346 |
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 |
9347 |
useful for non-standard keyboard layouts. */); |
useful for non-standard keyboard layouts. */); |