help on xkey.state

This is a discussion on help on xkey.state within the Xwindows forums, part of the Tools category; 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 ...

Go Back   Unix Linux Forum > Technologies & Tools > Tools > Xwindows

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 10-03-2008, 12:51 PM
Default 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

Reply With Quote
  #2  
Old 10-03-2008, 02:29 PM
Default 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 With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 12:45 AM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger