Fix crash when canceling menu with two-finger touch

Fixes #58.

It was a regression by commit eeeab6e.
This commit is contained in:
kichikuou
2024-11-12 08:55:36 +09:00
parent f786db5a50
commit 36e1dc152b
+5 -2
View File
@@ -461,7 +461,10 @@ void sel_select() {
key = sys_keywait(25, KEYWAIT_CANCELABLE);
// Right-click exits the menu without waiting for button up.
if (key == SYS35KEY_SPC) break;
if (key == SYS35KEY_SPC) {
curElement = -1;
break;
}
if (!key && prevkey == SYS35KEY_RET && curElement != -1) break;
prevkey = key;
@@ -536,7 +539,7 @@ void sel_select() {
msg_nextPage(TRUE);
}
if (prevkey == SYS35KEY_RET) {
if (curElement != -1) {
sl_jmpNear(elmv[curElement]);
if (cb_select_page != 0) {
sl_callFar2(cb_select_page -1, cb_select_address);