Getting the current state of the lock keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone.
I’d like to get the current state of the various “lock” keys on thekeyboard.  Is that possible with GTK+/GDK?  I want to do this withoutinspecting a key event, because the lock state might change while theprogram’s window does not have the focus.
The gdk_display_get_pointer() function looks like the right way to go,as it will give me a GdkModifierType bitfield.  GDK_LOCK_MASK seems tobe caps lock, but the other lock keys seem to be buried within theGDK_MODn_MASK bits.  The documentation tells me:
  GDK_MOD1_MASK   the fourth modifier key (it depends on the                  modifier mapping of the X server which key is		  interpreted as this modifier, but normally it is the		  Alt key).  GDK_MOD2_MASK   the fifth modifier key (it depends on the modifier                  mapping of the X server which key is interpreted as		  this modifier).  …
How can I determine which of these modifier keys the various other locks(num, scroll, kana, …) have been assigned to, so that I know which bitto check?  It must be possible to query the X server for thisinformation, since running 'xmodmap' can tell me that information, but Iwant to get this information from GTK+/GDK.  What if my program isn’trunning under X?  Is there some default mapping of lock keys to bitsused?
Thanks,
Cameron
-- Cameron McCormack, http://mcc.id.au/	xmpp:heycam@xxxxxxxxxx  ▪  ICQ 26955922  ▪  MSN cam@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx mailing listgtk-list@xxxxxxxxxxxxx://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux