diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2018-03-26 15:33:22 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2018-03-26 15:33:22 +0000 |
| commit | e8818e968cea0d05cd7aa27553a964c16813e422 (patch) | |
| tree | b549d41e403c8b8c8bd4ed5d3b77681734192e16 /src/Fl.cxx | |
| parent | 20ed92fca49784ed1af09d4b2b81b05a1aa8b2ea (diff) | |
Android: Widgets can now request the on-screen keyboard when they get focus. This may fail if visible_focus is disabled.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12804 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
| -rw-r--r-- | src/Fl.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 7aa0a3bfd..3c0c92654 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -863,9 +863,18 @@ Fl_Widget* fl_oldfocus; // kludge for Fl_Group... \see Fl_Widget::take_focus() */ -void Fl::focus(Fl_Widget *o) { - if (o && !o->visible_focus()) return; +void Fl::focus(Fl_Widget *o) +{ if (grab()) return; // don't do anything while grab is on + + // request an on-screen keyboard on touch screen devices if needed + Fl_Widget *prevFocus = Fl::focus(); + if ( prevFocus && (prevFocus->flags()&Fl_Widget::NEEDS_KEYBOARD) ) + Fl::screen_driver()->release_keyboard(); + if (o && (o->flags()&Fl_Widget::NEEDS_KEYBOARD)) + Fl::screen_driver()->request_keyboard( /*o->type()*/ ); + + if (o && !o->visible_focus()) return; Fl_Widget *p = focus_; if (o != p) { Fl::compose_reset(); |
