From: Mikko Rasa Date: Thu, 15 Sep 2016 14:54:15 +0000 (+0300) Subject: Focus entry widget on touch press X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=commitdiff_plain;h=46def086def19c58fb9e577312c07f2f7e758b34 Focus entry widget on touch press --- diff --git a/source/entry.cpp b/source/entry.cpp index 6616054..8d3c47f 100644 --- a/source/entry.cpp +++ b/source/entry.cpp @@ -126,6 +126,13 @@ void Entry::render_special(const Part &part, GL::Renderer &renderer) const slider->render(renderer); } +void Entry::touch_press(int x, int y, unsigned finger) +{ + if(finger==0) + set_focus(); + Widget::touch_press(x, y, finger); +} + bool Entry::key_press(unsigned key, unsigned) { got_key_press = true; diff --git a/source/entry.h b/source/entry.h index 82a9d79..a3b1607 100644 --- a/source/entry.h +++ b/source/entry.h @@ -70,6 +70,7 @@ private: virtual void render_special(const Part &, GL::Renderer &) const; public: + virtual void touch_press(int, int, unsigned); virtual bool key_press(unsigned, unsigned); virtual bool character(wchar_t); virtual void focus_out();