]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/container.cpp
Make keyboard event handlers indicate whether the event was handled
[libs/gltk.git] / source / container.cpp
index d02cc606394298c612bd7c94142298f88ffaf708..068986b15aca7b329626974c6349941a8d68422f 100644 (file)
@@ -272,22 +272,28 @@ void Container::touch_motion(int x, int y, unsigned finger)
        }
 }
 
-void Container::key_press(unsigned key, unsigned mod)
+bool Container::key_press(unsigned key, unsigned mod)
 {
        if(input_focus)
-               input_focus->key_press(key, mod);
+               return input_focus->key_press(key, mod);
+       else
+               return false;
 }
 
-void Container::key_release(unsigned key, unsigned mod)
+bool Container::key_release(unsigned key, unsigned mod)
 {
        if(input_focus)
-               input_focus->key_release(key, mod);
+               return input_focus->key_release(key, mod);
+       else
+               return false;
 }
 
-void Container::character(wchar_t ch)
+bool Container::character(wchar_t ch)
 {
        if(input_focus)
-               input_focus->character(ch);
+               return input_focus->character(ch);
+       else
+               return false;
 }
 
 void Container::focus_out()