/[emacs]/emacs/src/macterm.c
ViewVC logotype

Diff of /emacs/src/macterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.47.2.9 by miles, Thu Oct 14 08:49:53 2004 UTC revision 1.47.2.10 by miles, Thu Nov 4 08:55:31 2004 UTC
# Line 230  extern int errno; Line 230  extern int errno;
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
# Line 7014  Lisp_Object Qreverse; Line 7018  Lisp_Object Qreverse;
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    
# Line 7095  mac_to_emacs_modifiers (EventModifiers m Line 7102  mac_to_emacs_modifiers (EventModifiers m
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    
# Line 8575  XTread_socket (sd, expected, hold_quit) Line 8588  XTread_socket (sd, expected, hold_quit)
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;
# Line 9274  syms_of_macterm () Line 9298  syms_of_macterm ()
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);
# Line 9330  to 4.1, set this to nil.  */); Line 9362  to 4.1, set this to nil.  */);
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.  */);

Legend:
Removed from v.1.47.2.9  
changed lines
  Added in v.1.47.2.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26