Re: hardware keycode within cygwin



Hi,

*Tor Lillqvist <tml iki fi> [04/06/11]:
Tobias Werth writes:
 > I'm developing a GUI which should be able to run within cygwin and linux.
 > If the user presses a key over a special window, I need the lower level
 > hardware keycode.
Why?

Because we are developing some sort of virtual machine and the user can change
the keyboard mapping inside the virtual machine. So I don't need the value,
but the scancode of the key, because I don't know if the user's mapping inside
and outside the virtual machine is equivalent.


 > By catching the key event under linux this is no problem, because in struct
 > GdKEventKey there is a member hardware_keycode. This works for several
 > linux-distros. But within cygwin this member doesn't contain the hardware
 > keycode.

With "within Cygwin", do you mean GTK+ built for Win32 or X11?
I assume for Win32. I hope you are not using the "native Win32" GTK
DLLs from a Cygwin program?  That is not supported, although it might
work. (But not relevant for this discussion.)

Yes, it's for Win32. I got the DLL from here: http://www.gimp.org/win32/ (link
seems broken at the moment). Which DLLs should I use?


It was a deliberate design decision back in 2002 (by me) to use the
Windows virtual key code for hardware_keycodes.

Thank you for your long explanation - nevertheless it would be great to get
the hardware_keycode from the keyboard.


 > Is there any other way to get the hardware keycode with gdk/gtk/glib
 > functions?

You could try playing with GDK event filters. They are called with the
raw Windows MSG.


I will have a look at it and try it with these functions.

Thanks,
Tobias Werth



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