diff options
author | frosch <frosch@openttd.org> | 2012-12-05 19:34:25 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-12-05 19:34:25 +0000 |
commit | 5b2da98ca312f91c93012e7a92fb1120d2b9d1fa (patch) | |
tree | 8533bc018200a14e22a82a2c648c71581ba13126 /src/misc_gui.cpp | |
parent | b3bd33adfb22a068b43c264b35c111e28d456492 (diff) | |
download | openttd-5b2da98ca312f91c93012e7a92fb1120d2b9d1fa.tar.xz |
(svn r24785) -Add: Various methods to open the OSK. (based on patch by Eagle_rainbow)
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 3a87437d7..9c90b927a 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -30,6 +30,15 @@ #include "table/strings.h" +/** Method to open the OSK. */ +enum OskActivation { + OSKA_DISABLED, ///< The OSK shall not be activated at all. + OSKA_DOUBLE_CLICK, ///< Double click on the edit box opens OSK. + OSKA_SINGLE_CLICK, ///< Single click after focus click opens OSK. + OSKA_IMMEDIATELY, ///< Focussing click already opens OSK. +}; + + static const NWidgetPart _nested_land_info_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -835,8 +844,10 @@ void QueryString::ClickEditBox(Window *w, Point pt, int wid, int click_count, bo return; } - if (!focus_changed && w->window_class != WC_OSK) { - /* Open the OSK window if clicked on an edit box, while not changing focus */ + if (w->window_class != WC_OSK && _settings_client.gui.osk_activation != OSKA_DISABLED && + (!focus_changed || _settings_client.gui.osk_activation == OSKA_IMMEDIATELY) && + (click_count == 2 || _settings_client.gui.osk_activation != OSKA_DOUBLE_CLICK)) { + /* Open the OSK window */ ShowOnScreenKeyboard(w, wid); } } |