From: Mikko Rasa Date: Tue, 30 Aug 2016 12:51:16 +0000 (+0300) Subject: Reorder event handling functions X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=18a5af8e80903eb9738cefe03825595877fbf447;p=libs%2Fgltk.git Reorder event handling functions --- diff --git a/source/container.cpp b/source/container.cpp index 21d31fb..d02cc60 100644 --- a/source/container.cpp +++ b/source/container.cpp @@ -237,24 +237,6 @@ void Container::pointer_leave() set_pointer_focus(0); } -void Container::key_press(unsigned key, unsigned mod) -{ - if(input_focus) - input_focus->key_press(key, mod); -} - -void Container::key_release(unsigned key, unsigned mod) -{ - if(input_focus) - input_focus->key_release(key, mod); -} - -void Container::character(wchar_t ch) -{ - if(input_focus) - input_focus->character(ch); -} - void Container::touch_press(int x, int y, unsigned finger) { if(Widget *child = get_pointer_target(x, y, true)) @@ -290,6 +272,24 @@ void Container::touch_motion(int x, int y, unsigned finger) } } +void Container::key_press(unsigned key, unsigned mod) +{ + if(input_focus) + input_focus->key_press(key, mod); +} + +void Container::key_release(unsigned key, unsigned mod) +{ + if(input_focus) + input_focus->key_release(key, mod); +} + +void Container::character(wchar_t ch) +{ + if(input_focus) + input_focus->character(ch); +} + void Container::focus_out() { set_input_focus(0); diff --git a/source/container.h b/source/container.h index 89e3259..6c75e38 100644 --- a/source/container.h +++ b/source/container.h @@ -73,11 +73,11 @@ private: Widget *get_pointer_target(int, int, bool) const; public: virtual void pointer_leave(); - virtual void key_press(unsigned, unsigned); - virtual void key_release(unsigned, unsigned); virtual void touch_press(int, int, unsigned); virtual void touch_release(int, int, unsigned); virtual void touch_motion(int, int, unsigned); + virtual void key_press(unsigned, unsigned); + virtual void key_release(unsigned, unsigned); virtual void character(wchar_t); virtual void focus_out(); protected: diff --git a/source/widget.h b/source/widget.h index 557e101..2bf751a 100644 --- a/source/widget.h +++ b/source/widget.h @@ -136,12 +136,12 @@ public: virtual void pointer_motion(int, int) { } virtual void pointer_enter(); virtual void pointer_leave(); - virtual void key_press(unsigned, unsigned) { } - virtual void key_release(unsigned, unsigned) { } - virtual void character(wchar_t) { } virtual void touch_press(int, int, unsigned); virtual void touch_release(int, int, unsigned); virtual void touch_motion(int, int, unsigned); + virtual void key_press(unsigned, unsigned) { } + virtual void key_release(unsigned, unsigned) { } + virtual void character(wchar_t) { } virtual void focus_in(); virtual void focus_out(); protected: