summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-08-19 11:55:57 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-08-23 09:50:04 +1000
commit58a9dfb65164095f32b1d5f7070015da5111d884 (patch)
treee045af9dd0431222f914ad114cc88feb11571bd1
parentd2bb9b5a636753586e9d6b2b3606770a2bff6a11 (diff)
downloadpetitboot-58a9dfb65164095f32b1d5f7070015da5111d884.zip
petitboot-58a9dfb65164095f32b1d5f7070015da5111d884.tar.gz
ui/ncurses: Treat left/right arrow keys properly
It turns out ncurses helpfully provides REQ_LEFT_FIELD and REQ_RIGHT_FIELD to navigate between visually horizontal fields. Update widgetset_process_key() to use these for KEY_LEFT and KEY_RIGHT respectively. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--ui/ncurses/nc-widgets.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/ncurses/nc-widgets.c b/ui/ncurses/nc-widgets.c
index 7dc2df3..15cec80 100644
--- a/ui/ncurses/nc-widgets.c
+++ b/ui/ncurses/nc-widgets.c
@@ -1132,14 +1132,12 @@ bool widgetset_process_key(struct nc_widgetset *set, int key)
tab = true;
/* fall through */
case KEY_UP:
- case KEY_LEFT:
req = REQ_SPREV_FIELD;
break;
case '\t':
tab = true;
/* fall through */
case KEY_DOWN:
- case KEY_RIGHT:
req = REQ_SNEXT_FIELD;
break;
case KEY_PPAGE:
@@ -1148,6 +1146,12 @@ bool widgetset_process_key(struct nc_widgetset *set, int key)
case KEY_NPAGE:
req = REQ_SLAST_FIELD;
break;
+ case KEY_LEFT:
+ req = REQ_LEFT_FIELD;
+ break;
+ case KEY_RIGHT:
+ req = REQ_RIGHT_FIELD;
+ break;
}
if (req) {
OpenPOWER on IntegriCloud