]> git.eshelyaron.com Git - emacs.git/commitdiff
* macterm.c (XTread_socket): Call KeyTranslate for control and
authorSteven Tamm <steventamm@mac.com>
Sun, 22 Dec 2002 21:09:20 +0000 (21:09 +0000)
committerSteven Tamm <steventamm@mac.com>
Sun, 22 Dec 2002 21:09:20 +0000 (21:09 +0000)
meta to deal correctly shifted non-alpha characters, like C-S-5
being treated like C-%.  Does not look for shift key to deal
with masking off control-key with mac-reverse-ctrl-meta.

src/ChangeLog
src/macterm.c

index 6de8602e6f69e19e307a745c8a5062f1dded7b15..54772be0304bf1169fa84ffd7f7d385dfdf0cb25 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-22  Steven Tamm  <steventamm@mac.com>
+
+       * macterm.c (XTread_socket): Call KeyTranslate for control and
+       meta to deal correctly shifted non-alpha characters, like C-S-5
+       being treated like C-%.  Does not look for shift key to deal
+       with masking off control-key with mac-reverse-ctrl-meta.
+
 2002-12-21  Richard M. Stallman  <rms@gnu.org>
 
        * xmenu.c (popup_get_selection): Now static.  New arg DO_TIMERS.
index d229952436262017d1157106a4c7442a809483fd..0e97e6bbb30055e8e3a5a2776681f7ab610b894c 100644 (file)
@@ -12931,26 +12931,19 @@ XTread_socket (int sd, struct input_event *bufp, int numchars, int expected)
              bufp->code = 0xff00 | xkeysym;
              bufp->kind = NON_ASCII_KEYSTROKE_EVENT;
            }      
-         else if (!NILP (Vmac_reverse_ctrl_meta) && (er.modifiers & controlKey))
-           {
-             /* This is a special case to deal with converting from
-                a control character to non-control character */
-             int new_modifiers = er.modifiers & ~controlKey;
-             int new_keycode = keycode | new_modifiers;              
-             Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
-             unsigned long some_state = 0;
-             bufp->code = KeyTranslate (kchr_ptr, new_keycode, &some_state) & 0xff;
-             bufp->kind = ASCII_KEYSTROKE_EVENT;
-           }
          else
            {
-             if (er.modifiers & macMetaKey)
+             if (er.modifiers & (controlKey | 
+                                 (NILP (Vmac_command_key_is_meta) ? optionKey 
+                                  : cmdKey)))
                {
                  /* This code comes from Keyboard Resource, Appendix
                     C of IM - Text.  This is necessary since shift is
                     ignored in KCHR table translation when option or
-                    command is pressed. */
-                 int new_modifiers = er.modifiers & 0xf600;
+                    command is pressed.  It also does not translate 
+                    correctly control-shift chars like C-% so mask off
+                    shift here also */
+                 int new_modifiers = er.modifiers & 0xe600;
                  /* mask off option and command */
                  int new_keycode = keycode | new_modifiers;
                  Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);