From 3874e3e275b30d12d213bd65798224a717627ba2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 30 Aug 2011 21:26:21 +0300 Subject: [PATCH] Avoid generating events for unknown keys --- source/input/keyboard.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.43.0