From 476c0001e17dd2ff54d11beb56e7668b189aac1f Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 16 Mar 2004 06:32:05 +0000 Subject: [PATCH] (mwin__parse_event): Fix handling of modifier keys. --- src/m17n-X.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/m17n-X.c b/src/m17n-X.c index d9f7037..235d81a 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -1979,18 +1979,14 @@ mwin__parse_event (MFrame *frame, void *arg, int *modifiers) return Mnil; if (len == 1) { - int c = buf[0]; + int c = keysym; + if (c < XK_space || c > XK_asciitilde) + c = buf[0]; if ((c == ' ' || c == 127) && ((XKeyEvent *) event)->state & ShiftMask) *modifiers |= MINPUT_KEY_SHIFT_MODIFIER; - if (((XKeyEvent *) event)->state & ControlMask) - { - c &= 0x1F; - if (((XKeyEvent *) event)->state & ShiftMask) - *modifiers |= MINPUT_KEY_SHIFT_MODIFIER; - } - if (((XKeyEvent *) event)->state & disp_info->meta_mask) - c |= 0x80; + if ((c >= ' ' && c < 127) && ((XKeyEvent *) event)->state & ControlMask) + *modifiers |= MINPUT_KEY_CONTROL_MODIFIER; key = minput__char_to_key (c); } else if (keysym >= XK_Shift_L && keysym <= XK_Hyper_R) -- 1.7.10.4