From ba837a789e0c51f6a5308e5e4918aa5b79ab8920 Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Mon, 6 Jun 2022 19:54:10 +0800 Subject: [PATCH] input: fix: vibration test could stick. --- input.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input.cpp b/input.cpp index 16ab6bb..62cbd03 100644 --- a/input.cpp +++ b/input.cpp @@ -4864,7 +4864,7 @@ int input_test(int getchar) if (ev.code == (input[dev].mmap[SYS_BTN_L] & 0xFFFF)) input[dev].rumble_en = ev.value; int n = get_rumble_device(input[dev].num); - if (n >= 0 && input[dev].rumble_en) + if (n >= 0 && (input[dev].rumble_en || !ev.value)) { uint16_t rumble_val = input[n].last_rumble; if (ev.code == (input[dev].mmap[SYS_BTN_X] & 0xFFFF)) set_rumble(n, (rumble_val & 0xFF00) | ((ev.value) ? 0xFF : 0x00));