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)