Search
lxdream.org :: lxdream/src/gtkui/gtkui.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gtkui/gtkui.c
changeset 608:4f588e52bce0
prev561:533f6b478071
next618:3ade50e8603c
author nkeynes
date Sat Jan 26 02:45:27 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Bug #50: Implement mouse and keyboard
file annotate diff log raw
1.1 --- a/src/gtkui/gtkui.c Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/gtkui/gtkui.c Sat Jan 26 02:45:27 2008 +0000
1.3 @@ -225,6 +225,7 @@
1.4 GtkWidget *gdrommenu = gdrom_menu_new();
1.5 gtk_menu_item_set_submenu( GTK_MENU_ITEM(gdrommenuitem), gdrommenu );
1.6 main_win = main_window_new( APP_NAME " " APP_VERSION, menubar, toolbar, accel_group );
1.7 + main_window_set_use_grab(main_win, TRUE);
1.8 if( withDebug ) {
1.9 gtk_gui_show_debugger();
1.10 }
1.11 @@ -473,3 +474,20 @@
1.12 delete_frame_buffer,
1.13 buffer );
1.14 }
1.15 +
1.16 +/**
1.17 + * Extract the keyval of the key event if no modifier keys were pressed -
1.18 + * in other words get the keyval of the key by itself. The other way around
1.19 + * would be to use the hardware keysyms directly rather than the keyvals,
1.20 + * but the mapping looks to be messier.
1.21 + */
1.22 +uint16_t gtk_get_unmodified_keyval( GdkEventKey *event )
1.23 +{
1.24 + GdkKeymap *keymap = gdk_keymap_get_default();
1.25 + guint keyval;
1.26 +
1.27 + gdk_keymap_translate_keyboard_state( keymap, event->hardware_keycode, 0, 0, &keyval,
1.28 + NULL, NULL, NULL );
1.29 + return keyval;
1.30 +}
1.31 +
.