From: kub Date: Thu, 26 Jan 2023 21:00:48 +0000 (+0000) Subject: fix menu key handling in file selector X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=libpicofe.git;a=commitdiff_plain;h=9bc19b0fe55420a424f01326ccbc559dc7f1e3f9 fix menu key handling in file selector --- diff --git a/menu.c b/menu.c index fd7fe5a..96b1ea2 100644 --- a/menu.c +++ b/menu.c @@ -1108,14 +1108,14 @@ rescan: namelist[sel]->d_name); goto rescan; } - if (inp & PBTN_UP ) { sel--; if (sel < 0) sel = n-1; } - if (inp & PBTN_DOWN) { sel++; if (sel > n-1) sel = 0; } - if (inp & PBTN_LEFT) { sel-=10; if (sel < 0) sel = 0; } - if (inp & PBTN_L) { sel-=24; if (sel < 0) sel = 0; } - if (inp & PBTN_RIGHT) { sel+=10; if (sel > n-1) sel = n-1; } - if (inp & PBTN_R) { sel+=24; if (sel > n-1) sel = n-1; } - - if ((inp & PBTN_MOK) || (inp & (PBTN_MENU|PBTN_MA2)) == (PBTN_MENU|PBTN_MA2)) + if (inp & PBTN_UP ) { sel--; if (sel < 0) sel = n-1; } + else if (inp & PBTN_DOWN) { sel++; if (sel > n-1) sel = 0; } + else if (inp & PBTN_LEFT) { sel-=10; if (sel < 0) sel = 0; } + else if (inp & PBTN_RIGHT) { sel+=10; if (sel > n-1) sel = n-1; } + else if (inp & PBTN_L) { sel-=24; if (sel < 0) sel = 0; } + else if (inp & PBTN_R) { sel+=24; if (sel > n-1) sel = n-1; } + + else if ((inp & PBTN_MOK) || (inp & (PBTN_MENU|PBTN_MA2)) == (PBTN_MENU|PBTN_MA2)) { if (namelist[sel]->d_type == DT_REG) {