Mercurial > emacs
changeset 2047:e179f9f55aa8
(x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables.
(x_find_modifier_meanings): Set them.
(x_convert_modifiers): Check for them.
(XTread_socket): Handle BackSpace, etc, function keys.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 07 Mar 1993 09:30:31 +0000 |
parents | 9e30cf115e63 |
children | 8cf58355e8a1 |
files | src/xterm.c |
diffstat | 1 files changed, 29 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xterm.c Sun Mar 07 09:29:36 1993 +0000 +++ b/src/xterm.c Sun Mar 07 09:30:31 1993 +0000 @@ -1385,6 +1385,9 @@ (EVENT.state & x_shift_lock_mask) != 0. */ static int x_meta_mod_mask, x_shift_lock_mask; +/* These are like x_meta_mod_mask, but for different modifiers. */ +static int x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask; + /* Initialize mode_switch_bit and modifier_meaning. */ static void x_find_modifier_meanings () @@ -1393,10 +1396,12 @@ KeySym *syms; int syms_per_code; XModifierKeymap *mods; - int alt_mod_mask = 0; x_meta_mod_mask = 0; x_shift_lock_mask = 0; + x_alt_mod_mask = 0; + x_super_mod_mask = 0; + x_hyper_mod_mask = 0; XDisplayKeycodes (x_current_display, &min_code, &max_code); syms = XGetKeyboardMapping (x_current_display, @@ -1432,7 +1437,17 @@ case XK_Alt_L: case XK_Alt_R: - alt_mod_mask |= (1 << row); + x_alt_mod_mask |= (1 << row); + break; + + case XK_Hyper_L: + case XK_Hyper_R: + x_hyper_mod_mask |= (1 << row); + break; + + case XK_Super_L: + case XK_Super_R: + x_super_mod_mask |= (1 << row); break; case XK_Shift_Lock: @@ -1448,7 +1463,10 @@ /* If we couldn't find any meta keys, accept any alt keys as meta keys. */ if (! x_meta_mod_mask) - x_meta_mod_mask = alt_mod_mask; + { + x_meta_mod_mask = x_alt_mod_mask; + x_alt_mod_mask = 0; + } XFree ((char *) syms); XFreeModifiermap (mods); @@ -1464,7 +1482,10 @@ { return ( ((state & (ShiftMask | x_shift_lock_mask)) ? shift_modifier : 0) | ((state & ControlMask) ? ctrl_modifier : 0) - | ((state & x_meta_mod_mask) ? meta_modifier : 0)); + | ((state & x_meta_mod_mask) ? meta_modifier : 0) + | ((state & x_alt_mod_mask) ? alt_modifier : 0) + | ((state & x_super_mod_mask) ? super_modifier : 0) + | ((state & x_hyper_mod_mask) ? hyper_modifier : 0)); } /* Prepare a mouse-event in *RESULT for placement in the input queue. @@ -2721,13 +2742,15 @@ if (numchars > 1) { - if (IsCursorKey (keysym) /* 0xff50 <= x < 0xff60 */ + if ((keysym >= XK_BackSpace && keysym <= XK_Escape) + || keysym == XK_Delete + || IsCursorKey (keysym) /* 0xff50 <= x < 0xff60 */ || IsMiscFunctionKey (keysym) /* 0xff60 <= x < 0xff80 */ || IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */ || IsFunctionKey (keysym)) /* 0xffbe <= x < 0xffe1 */ { bufp->kind = non_ascii_keystroke; - XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff50); + XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff00); XSET (bufp->frame_or_window, Lisp_Frame, f); bufp->modifiers = x_convert_modifiers (modifiers); bufp->timestamp = event.xkey.time;