/[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.3.2.20 by miles, Mon Oct 25 04:19:35 2004 UTC revision 1.3.2.21 by miles, Fri Oct 29 02:05:10 2004 UTC
# Line 228  extern int errno; Line 228  extern int errno;
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
# Line 6988  Lisp_Object Qreverse; Line 6992  Lisp_Object Qreverse;
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    
# Line 7069  mac_to_emacs_modifiers (EventModifiers m Line 7076  mac_to_emacs_modifiers (EventModifiers m
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    
# Line 8549  XTread_socket (sd, expected, hold_quit) Line 8562  XTread_socket (sd, expected, hold_quit)
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;
# Line 9248  syms_of_macterm () Line 9272  syms_of_macterm ()
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);
# Line 9304  to 4.1, set this to nil.  */); Line 9336  to 4.1, set this to nil.  */);
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.  */);

Legend:
Removed from v.1.3.2.20  
changed lines
  Added in v.1.3.2.21

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