| Unix Content | Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| hi, i'm a relatively new user of xlib. my question(s) is: when i catch a keypress event is there a mode to know a priori (on all machines) at wich xkey.state correspond every keymask? for example when i press shift+a, on the second stroke the state member is different from pc to pc (or from keyboard to keyboard) : sometimes it gives 0, other times 16, 17 another fact is that all modifier keys of my keyboard are seen like mod2mask so i can't know for every modkey at what mask it correspond thanks for interesting michele |
|
#2
|
| On Oct 3, 9:51*am, michele > hi, > i'm a relatively new user of xlib. > > my question(s) is: > > when i catch a keypress event is there a mode to know a priori (on all > machines) at wich xkey.state correspond every keymask? > > for example when i press shift+a, on the second stroke the state > member is different from pc to pc (or from keyboard to keyboard) : > sometimes it gives 0, other times 16, 17 > > another fact is that all modifier keys of my keyboard are seen like > mod2mask so i can't know for every modkey at what mask it correspond > > thanks for interesting > You need to use XLookupString() to interpret the keycode. You have a serious problem with your implementation if all modifiers claim to match mod2mask. Are you sure you are checking properly? ( event->state & ControlMask ) should be true if the Control key is down, and false if not. -- Fred Kleinschmidt |