mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Improved scroll delay handling
This commit is contained in:
parent
b572dac3be
commit
a40e617274
@ -2,15 +2,20 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
u32 InputWait() {
|
u32 InputWait() {
|
||||||
|
static u64 delay = 0;
|
||||||
u32 pad_state_old = HID_STATE;
|
u32 pad_state_old = HID_STATE;
|
||||||
|
delay = (delay) ? 80 : 400;
|
||||||
timer_start();
|
timer_start();
|
||||||
while (true) {
|
while (true) {
|
||||||
u32 pad_state = HID_STATE;
|
u32 pad_state = HID_STATE;
|
||||||
if (!(~pad_state & BUTTON_ANY)) { // no buttons pressed
|
if (!(~pad_state & BUTTON_ANY)) { // no buttons pressed
|
||||||
pad_state_old = pad_state;
|
pad_state_old = pad_state;
|
||||||
|
delay = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((pad_state == pad_state_old) && (!(pad_state & BUTTON_ARROW) || timer_msec() < 120))
|
if ((pad_state == pad_state_old) &&
|
||||||
|
(!(~pad_state & BUTTON_ARROW) ||
|
||||||
|
(delay && (timer_msec() < delay))))
|
||||||
continue;
|
continue;
|
||||||
//Make sure the key is pressed
|
//Make sure the key is pressed
|
||||||
u32 t_pressed = 0;
|
u32 t_pressed = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user