Re: hardware keycode
- From: Noah Levitt <nlevitt columbia edu>
- To: Peter Gasper <pgasper designadvantage com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: hardware keycode
- Date: Mon, 18 Aug 2003 17:22:51 -0400
It looks to me like gdk_keymap_get_entries_for_keyval is
what you want, and you just have memory management problems.
keys and n_keys are probably not allocated.
gdk_keymap_get_entries_for_keyval (NULL, GDK_1, &keys, &n_keys);
On Mon, Aug 18, 2003 at 14:37:45 -0600, Peter Gasper wrote:
I am creating an GdkEvent manually. How do I determine the hardware keycode for a
key in gdk/gdkkeysyms.h so I can fill in the value?
Or is that something which is dependent on the installation/system? If so how? Is
there a way to discover the hardware keycodes at runtime?
I tried using gdk_keymap_get_entries_for_keyval to do this but I got segfaults in the else portion of the
if( !gdk_keymap_get_entries_for_keyval(NULL, GDK_1, keys, n_keys) )
cout << "Keyval translation failed." << endl;
cout << *n_keys << endl;
cout << "hardware_keycode: " << keys->keycode << endl;
cout << "group: " << keys->group << endl;
cout << "level: " << keys->level << endl;
cout << "done" << endl;
] [Thread Prev