hardware keycode



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 
following code.
                        

                        GdkKeymapKey **keys;
                        gint *n_keys;
                        if( !gdk_keymap_get_entries_for_keyval(NULL, GDK_1, keys, n_keys) )
                        {
                                cout << "Keyval translation failed." << endl;
                        }
                        else
                        {
                                cout << *n_keys << endl;
                                cout << "hardware_keycode: " << keys[0]->keycode << endl;
                                cout << "group: " << keys[0]->group << endl;
                                cout << "level: " << keys[0]->level << endl;
                                cout << "done" << endl;
                        }




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