]> git.tdb.fi Git - libs/gui.git/commitdiff
Avoid generating events for unknown keys
authorMikko Rasa <tdb@tdb.fi>
Tue, 30 Aug 2011 18:26:21 +0000 (21:26 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 30 Aug 2011 18:26:21 +0000 (21:26 +0300)
source/input/keyboard.cpp

index ea66cf28ab11aa9d74f55680293336f4e5efae83..5b54ee4c0784f4210548b270e80e0942d0ad14d6 100644 (file)
@@ -66,7 +66,8 @@ void Keyboard::input_event(const Graphics::Window::Event &event)
                {
                        KeySym keysym = XKeycodeToKeysym(window.get_display().get_private().display, event.xevent.xkey.keycode, 0);
                        if(keysym!=NoSymbol)
-                               set_button_state(key_from_sys(keysym), event.xevent.type==KeyPress, true);
+                               if(unsigned key = key_from_sys(keysym))
+                                       set_button_state(key, event.xevent.type==KeyPress, true);
                        if(event.xevent.type==KeyPress)
                        {
                                char ch;