all repos — mgba @ 5039d17a3048224b57fef74d468133a16c4bda04

mGBA Game Boy Advance Emulator

mGUI: Increase key delay
Vicki Pfau vi@endrift.com
Wed, 19 Sep 2018 19:20:29 -0700
commit

5039d17a3048224b57fef74d468133a16c4bda04

parent

eb7f12b574e140f809dc9570f948f298fb5571bb

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M src/util/gui.csrc/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); } }