summaryrefslogtreecommitdiff
path: root/src/touchscreengui.h
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2015-03-24 22:19:32 +1000
committerCraig Robbins <kde.psych@gmail.com>2015-03-24 22:19:32 +1000
commit9fbc3a8ca364922bc1129a35c1a37addab5f023c (patch)
tree1a87ef6d06e7d8c7d655f55403956c5474562abc /src/touchscreengui.h
parent732d7b9a7c2a89bc21abb40b333f974a4b2474c4 (diff)
downloadminetest-9fbc3a8ca364922bc1129a35c1a37addab5f023c.tar.gz
minetest-9fbc3a8ca364922bc1129a35c1a37addab5f023c.tar.bz2
minetest-9fbc3a8ca364922bc1129a35c1a37addab5f023c.zip
Slow down the "key repeat" touch speed for some Android controls
Increases the key/buttons repeat delay for fly, noclip, fast, debug and camera buttons
Diffstat (limited to 'src/touchscreengui.h')
-rw-r--r--src/touchscreengui.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/touchscreengui.h b/src/touchscreengui.h
index a00df5c47..2ded26a05 100644
--- a/src/touchscreengui.h
+++ b/src/touchscreengui.h
@@ -54,6 +54,7 @@ typedef enum {
#define MIN_DIG_TIME_MS 500
#define MAX_TOUCH_COUNT 64
+#define BUTTON_REPEAT_DELAY 0.2f
extern const char** touchgui_button_imagenames;
@@ -105,6 +106,7 @@ private:
struct button_info {
float repeatcounter;
+ float repeatdelay;
irr::EKEY_CODE keycode;
std::vector<int> ids;
IGUIButton* guibutton;
@@ -124,7 +126,8 @@ private:
/* initialize a button */
void initButton(touch_gui_button_id id, rect<s32> button_rect,
- std::wstring caption, bool immediate_release );
+ std::wstring caption, bool immediate_release,
+ float repeat_delay = BUTTON_REPEAT_DELAY);
/* load texture */
void loadButtonTexture(button_info* btn, const char* path);