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 [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/macterm.c [emacs-unicode-2]
Date: Thu, 04 Nov 2004 04:05:22 -0500

Index: emacs/src/macterm.c
diff -c emacs/src/macterm.c:1.47.2.9 emacs/src/macterm.c:1.47.2.10
*** emacs/src/macterm.c:1.47.2.9        Thu Oct 14 08:49:53 2004
--- emacs/src/macterm.c Thu Nov  4 08:55:31 2004
***************
*** 230,235 ****
--- 230,239 ----
  
  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
***************
*** 7014,7019 ****
--- 7018,7026 ----
  /* 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;
  
***************
*** 7095,7100 ****
--- 7102,7113 ----
      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;
  }
  
***************
*** 8575,8581 ****
                    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;
--- 8588,8605 ----
                    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;
***************
*** 9274,9279 ****
--- 9298,9311 ----
    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);
***************
*** 9330,9335 ****
--- 9362,9373 ----
  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]