Re: keycode



On Sat, Mar 10, 2001 at 04:38:56PM +0100, Stefan Birgersson wrote:
I'm writing an application where I would like the physical location of a key 
determine its function rather than the keysym value. Is it possible to get 
the keycode instead of the keysym value using gdk/gtk?

#include <gdk/gdkx.h>

[...]

guint keycode = XKeysymToKeycode( gdk_display, keysym );

Whether a program _should_ be interpreting keycodes, rather than passing
them to the X server to get keysyms is trickier -- AFAIK, keycodes are
just magic numbers with have a meaning only to the X server, and will
differ significantly between machines/architectures, etc...

Phil

-- 
  Philip Kendall <pak ast cam ac uk>
  http://www.srcf.ucam.org/~pak21/




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