From: Mikko Rasa Date: Tue, 30 Aug 2011 18:26:21 +0000 (+0300) Subject: Avoid generating events for unknown keys X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3874e3e275b30d12d213bd65798224a717627ba2;p=libs%2Fgui.git Avoid generating events for unknown keys --- diff --git a/source/input/keyboard.cpp b/source/input/keyboard.cpp index ea66cf2..5b54ee4 100644 --- a/source/input/keyboard.cpp +++ b/source/input/keyboard.cpp @@ -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;