help on xkey.state - Xwindows

This is a discussion on help on xkey.state - Xwindows ; 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, ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: help on xkey.state

  1. help on xkey.state

    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. Re: help on xkey.state

    On Oct 3, 9:51*am, michele wrote:
    > 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

+ Reply to Thread