mGUI: Increase key delay
Vicki Pfau vi@endrift.com
Wed, 19 Sep 2018 19:20:29 -0700
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
src/util/gui.c
→
src/util/gui.c
@@ -5,6 +5,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <mgba-util/gui.h> +#define KEY_DELAY 45 +#define KEY_REPEAT 5 + void GUIInit(struct GUIParams* params) { memset(params->inputHistory, 0, sizeof(params->inputHistory)); strncpy(params->currentPath, params->basePath, PATH_MAX);@@ -19,7 +22,7 @@ ++params->inputHistory[i];
} else { params->inputHistory[i] = -1; } - if (!params->inputHistory[i] || (params->inputHistory[i] >= 30 && !(params->inputHistory[i] % 5))) { + if (!params->inputHistory[i] || (params->inputHistory[i] >= KEY_DELAY && !(params->inputHistory[i] % KEY_REPEAT))) { newInput |= (1 << i); } }