emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/macterm.c


From: John Wiegley
Subject: [Emacs-diffs] Changes to emacs/src/macterm.c
Date: Thu, 28 Oct 2004 20:06:07 -0400

Index: emacs/src/macterm.c
diff -c emacs/src/macterm.c:1.80 emacs/src/macterm.c:1.81
*** emacs/src/macterm.c:1.80    Sun Oct 10 16:56:20 2004
--- emacs/src/macterm.c Fri Oct 29 00:00:42 2004
***************
*** 228,233 ****
--- 228,237 ----
  
  extern int extra_keyboard_modifiers;
  
+ /* The keysyms to use for the various modifiers.  */
+ 
+ static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value;
+ 
  static Lisp_Object Qvendor_specific_keysyms;
  
  #if 0
***************
*** 6988,6993 ****
--- 6992,7000 ----
  /* True if using command key as meta key.  */
  Lisp_Object Vmac_command_key_is_meta;
  
+ /* Modifier associated with the option key, or nil for normal behavior. */
+ Lisp_Object Vmac_option_modifier;
+ 
  /* True if the ctrl and meta keys should be reversed.  */
  Lisp_Object Vmac_reverse_ctrl_meta;
  
***************
*** 7069,7074 ****
--- 7076,7087 ----
      result |= meta_modifier;
    if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey))
      result |= alt_modifier;
+   if (!NILP (Vmac_option_modifier) && (mods & optionKey)) {
+       Lisp_Object val = Fget(Vmac_option_modifier, Qmodifier_value);
+       if (!NILP(val))
+           result |= XUINT(val);
+   }
+ 
    return result;
  }
  
***************
*** 8549,8555 ****
                    unsigned long some_state = 0;
                    inev.code = KeyTranslate (kchr_ptr, new_keycode,
                                              &some_state) & 0xff;
!                 }
                else
                  inev.code = er.message & charCodeMask;
                inev.kind = ASCII_KEYSTROKE_EVENT;
--- 8562,8579 ----
                    unsigned long some_state = 0;
                    inev.code = KeyTranslate (kchr_ptr, new_keycode,
                                              &some_state) & 0xff;
!                 } else if (!NILP(Vmac_option_modifier) && (er.modifiers & 
optionKey))
!             {
!                 /* When using the option key as an emacs modifier, convert
!                    the pressed key code back to one without the Mac option
!                    modifier applied. */
!                 int new_modifiers = er.modifiers & ~optionKey;
!                 int new_keycode = keycode | new_modifiers;
!                 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
!                 unsigned long some_state = 0;
!                 inev.code = KeyTranslate (kchr_ptr, new_keycode,
!                                           &some_state) & 0xff;
!             }
                else
                  inev.code = er.message & charCodeMask;
                inev.kind = ASCII_KEYSTROKE_EVENT;
***************
*** 9248,9253 ****
--- 9272,9285 ----
    x_error_message_string = Qnil;
  #endif
  
+   Qmodifier_value = intern ("modifier-value");
+   Qalt = intern ("alt");
+   Fput (Qalt, Qmodifier_value, make_number (alt_modifier));
+   Qhyper = intern ("hyper");
+   Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier));
+   Qsuper = intern ("super");
+   Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
+ 
    Fprovide (intern ("mac-carbon"), Qnil);
  
    staticpro (&Qreverse);
***************
*** 9304,9309 ****
--- 9336,9347 ----
  Otherwise the option key is used.  */);
    Vmac_command_key_is_meta = Qt;
  
+   DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier,
+     doc: /* Modifier to use for the Mac alt/option key.  The value can
+ be alt, hyper, or super for the respective modifier.  If the value is
+ nil then the key will act as the normal Mac option modifier.  */);
+   Vmac_option_modifier = Qnil;
+ 
    DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta,
      doc: /* Non-nil means that the control and meta keys are reversed.  This 
is
            useful for non-standard keyboard layouts.  */);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]