]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/root.cpp
Make keyboard event handlers indicate whether the event was handled
[libs/gltk.git] / source / root.cpp
index a90ea5a23d9eec4a3b3bacc34b94fb1a912b8b4c..c54ab7b00682b78bd39041eb09565bc46cd3254d 100644 (file)
@@ -210,14 +210,7 @@ bool Root::key_press_event(unsigned key)
 {
        // XXX Modifiers
        if(visible)
-       {
-               Widget *old_focus = input_focus;
-
-               key_press(key, 0);
-
-               if(input_focus || old_focus)
-                       return true;
-       }
+               return key_press(key, 0);
 
        return false;
 }
@@ -225,14 +218,7 @@ bool Root::key_press_event(unsigned key)
 bool Root::key_release_event(unsigned key)
 {
        if(visible)
-       {
-               Widget *old_focus = input_focus;
-
-               key_release(key, 0);
-
-               if(input_focus || old_focus)
-                       return true;
-       }
+               return key_release(key, 0);
 
        return false;
 }
@@ -240,14 +226,7 @@ bool Root::key_release_event(unsigned key)
 bool Root::character_event(StringCodec::unichar ch)
 {
        if(visible)
-       {
-               Widget *old_focus = input_focus;
-
-               character(ch);
-
-               if(input_focus || old_focus)
-                       return true;
-       }
+               return character(ch);
 
        return false;
 }