1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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
This commit is contained in:
Craig Robbins 2015-03-24 22:19:32 +10:00
parent 732d7b9a7c
commit 9fbc3a8ca3
2 changed files with 17 additions and 9 deletions

View file

@ -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);