Re: mapping keys to functions



Am Donnerstag, den 02.03.2006, 17:23 -0600 schrieb Matt Hull:

is it possible to get an integer from a key press ?  are there any
standard integers for common keys ?  like enter, arrowup ?

working on a game and want the user to be able to map keys to
functions
using an array.  seems like the keys are enumerated. 

Keyboard-related events are handled by GdkEventKey structures, which
inter alia provide a keyval, which is an unsigned integer.
<gdk/gdkkeysyms.h> contains the relevant #defines. If you also want to
check which modifiers were pressed (shift, alt etc.) you'll have to
query the state member in the GdkEventKey struct.

-- 
Christian Neumair <chris gnome-de org>




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