aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-03-07 09:30:31 +0000
committerRichard M. Stallman1993-03-07 09:30:31 +0000
commita3c44b1451b833d5e766d09e67bdd5b0f43c98ae (patch)
tree2f87bf70ccce1a1879adcae14270d6d095c6e943 /src
parent3076b39de33d4e00c3279503864d79c68835d590 (diff)
downloademacs-a3c44b1451b833d5e766d09e67bdd5b0f43c98ae.tar.gz
emacs-a3c44b1451b833d5e766d09e67bdd5b0f43c98ae.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 14a8af82907..5ccb3c49525 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1385,6 +1385,9 @@ unsigned int x_mouse_grabbed;
1385 (EVENT.state & x_shift_lock_mask) != 0. */ 1385 (EVENT.state & x_shift_lock_mask) != 0. */
1386static int x_meta_mod_mask, x_shift_lock_mask; 1386static int x_meta_mod_mask, x_shift_lock_mask;
1387 1387
1388/* These are like x_meta_mod_mask, but for different modifiers. */
1389static int x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask;
1390
1388/* Initialize mode_switch_bit and modifier_meaning. */ 1391/* Initialize mode_switch_bit and modifier_meaning. */
1389static void 1392static void
1390x_find_modifier_meanings () 1393x_find_modifier_meanings ()
@@ -1393,10 +1396,12 @@ x_find_modifier_meanings ()
1393 KeySym *syms; 1396 KeySym *syms;
1394 int syms_per_code; 1397 int syms_per_code;
1395 XModifierKeymap *mods; 1398 XModifierKeymap *mods;
1396 int alt_mod_mask = 0;
1397 1399
1398 x_meta_mod_mask = 0; 1400 x_meta_mod_mask = 0;
1399 x_shift_lock_mask = 0; 1401 x_shift_lock_mask = 0;
1402 x_alt_mod_mask = 0;
1403 x_super_mod_mask = 0;
1404 x_hyper_mod_mask = 0;
1400 1405
1401 XDisplayKeycodes (x_current_display, &min_code, &max_code); 1406 XDisplayKeycodes (x_current_display, &min_code, &max_code);
1402 syms = XGetKeyboardMapping (x_current_display, 1407 syms = XGetKeyboardMapping (x_current_display,
@@ -1432,7 +1437,17 @@ x_find_modifier_meanings ()
1432 1437
1433 case XK_Alt_L: 1438 case XK_Alt_L:
1434 case XK_Alt_R: 1439 case XK_Alt_R:
1435 alt_mod_mask |= (1 << row); 1440 x_alt_mod_mask |= (1 << row);
1441 break;
1442
1443 case XK_Hyper_L:
1444 case XK_Hyper_R:
1445 x_hyper_mod_mask |= (1 << row);
1446 break;
1447
1448 case XK_Super_L:
1449 case XK_Super_R:
1450 x_super_mod_mask |= (1 << row);
1436 break; 1451 break;
1437 1452
1438 case XK_Shift_Lock: 1453 case XK_Shift_Lock:
@@ -1448,7 +1463,10 @@ x_find_modifier_meanings ()
1448 1463
1449 /* If we couldn't find any meta keys, accept any alt keys as meta keys. */ 1464 /* If we couldn't find any meta keys, accept any alt keys as meta keys. */
1450 if (! x_meta_mod_mask) 1465 if (! x_meta_mod_mask)
1451 x_meta_mod_mask = alt_mod_mask; 1466 {
1467 x_meta_mod_mask = x_alt_mod_mask;
1468 x_alt_mod_mask = 0;
1469 }
1452 1470
1453 XFree ((char *) syms); 1471 XFree ((char *) syms);
1454 XFreeModifiermap (mods); 1472 XFreeModifiermap (mods);
@@ -1464,7 +1482,10 @@ x_convert_modifiers (state)
1464{ 1482{
1465 return ( ((state & (ShiftMask | x_shift_lock_mask)) ? shift_modifier : 0) 1483 return ( ((state & (ShiftMask | x_shift_lock_mask)) ? shift_modifier : 0)
1466 | ((state & ControlMask) ? ctrl_modifier : 0) 1484 | ((state & ControlMask) ? ctrl_modifier : 0)
1467 | ((state & x_meta_mod_mask) ? meta_modifier : 0)); 1485 | ((state & x_meta_mod_mask) ? meta_modifier : 0)
1486 | ((state & x_alt_mod_mask) ? alt_modifier : 0)
1487 | ((state & x_super_mod_mask) ? super_modifier : 0)
1488 | ((state & x_hyper_mod_mask) ? hyper_modifier : 0));
1468} 1489}
1469 1490
1470/* Prepare a mouse-event in *RESULT for placement in the input queue. 1491/* Prepare a mouse-event in *RESULT for placement in the input queue.
@@ -2721,13 +2742,15 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
2721 2742
2722 if (numchars > 1) 2743 if (numchars > 1)
2723 { 2744 {
2724 if (IsCursorKey (keysym) /* 0xff50 <= x < 0xff60 */ 2745 if ((keysym >= XK_BackSpace && keysym <= XK_Escape)
2746 || keysym == XK_Delete
2747 || IsCursorKey (keysym) /* 0xff50 <= x < 0xff60 */
2725 || IsMiscFunctionKey (keysym) /* 0xff60 <= x < 0xff80 */ 2748 || IsMiscFunctionKey (keysym) /* 0xff60 <= x < 0xff80 */
2726 || IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */ 2749 || IsKeypadKey (keysym) /* 0xff80 <= x < 0xffbe */
2727 || IsFunctionKey (keysym)) /* 0xffbe <= x < 0xffe1 */ 2750 || IsFunctionKey (keysym)) /* 0xffbe <= x < 0xffe1 */
2728 { 2751 {
2729 bufp->kind = non_ascii_keystroke; 2752 bufp->kind = non_ascii_keystroke;
2730 XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff50); 2753 XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff00);
2731 XSET (bufp->frame_or_window, Lisp_Frame, f); 2754 XSET (bufp->frame_or_window, Lisp_Frame, f);
2732 bufp->modifiers = x_convert_modifiers (modifiers); 2755 bufp->modifiers = x_convert_modifiers (modifiers);
2733 bufp->timestamp = event.xkey.time; 2756 bufp->timestamp = event.xkey.time;