From: handa Date: Tue, 16 Mar 2004 06:32:05 +0000 (+0000) Subject: (mwin__parse_event): Fix handling of modifier keys. X-Git-Tag: REL-1-0-1~12 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=476c0001e17dd2ff54d11beb56e7668b189aac1f;p=m17n%2Fm17n-lib.git (mwin__parse_event): Fix handling of modifier keys. --- 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)