From eeeab6e05472c96dd55fddf592ea9cfd4bf829a8 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Tue, 18 Jun 2024 13:17:53 +0900 Subject: [PATCH] Right-click exits selection without waiting for button up This fixes https://github.com/kichikuou/xsystem35-sdl2/issues/56. --- src/selection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/selection.c b/src/selection.c index cbe9547..24a5e89 100644 --- a/src/selection.c +++ b/src/selection.c @@ -460,7 +460,9 @@ void sel_select() { while (!nact->is_quit) { key = sys_keywait(25, KEYWAIT_CANCELABLE); - if (!key && prevkey == SYS35KEY_SPC) break; + // Right-click exits the menu without waiting for button up. + if (key == SYS35KEY_SPC) break; + if (!key && prevkey == SYS35KEY_RET && curElement != -1) break; prevkey = key;