X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fsystemkeyboardinput.cpp;h=f5657bd7d49066d4c854279bfbfde8705ddbd55a;hb=37b46ec8dc03e090a6bec4a753233329a8335d41;hp=fe803a6ddd2e407abbe1cdbcadaed5ec4ce989da;hpb=1597579a34a8d87d4dea0a0cdc0895e6247b6126;p=libs%2Fgltk.git diff --git a/source/systemkeyboardinput.cpp b/source/systemkeyboardinput.cpp index fe803a6..f5657bd 100644 --- a/source/systemkeyboardinput.cpp +++ b/source/systemkeyboardinput.cpp @@ -16,6 +16,9 @@ SystemKeyboardInput::SystemKeyboardInput(Root &r, Input::Keyboard &k): bool SystemKeyboardInput::key_press(unsigned key) { + if(!root.is_visible()) + return false; + // TODO modifiers if(root.key_press(key, 0)) return true; @@ -37,12 +40,18 @@ bool SystemKeyboardInput::key_press(unsigned key) bool SystemKeyboardInput::key_release(unsigned key) { - return root.key_release(key, 0); + if(root.is_visible()) + return root.key_release(key, 0); + else + return false; } bool SystemKeyboardInput::character(StringCodec::unichar ch) { - return root.character(ch); + if(root.is_visible()) + return root.character(ch); + else + return false; } } // namespace GLtk