]> git.ozlabs.org Git - petitboot/commit
ui/ncurses: Call widget process_key handlers first
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Thu, 21 Jul 2016 03:03:28 +0000 (13:03 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Thu, 21 Jul 2016 05:39:37 +0000 (15:39 +1000)
commit297d2f0cc9c0a233fadf42dacc08708ad3909f77
tree7d7f679bbd675e6e95167dbbcbfeda5fd340ecd9
parent7e6dd06b20beda18d07ce725e4d8c4473d10d902
ui/ncurses: Call widget process_key handlers first

Adding KEY_LEFT and KEY_RIGHT brought to light the problem that
widgetset_process_keys() may handle keystrokes that would have also been
handled by a widget's process_keys function. In particular the cursor
in a textbox widget could no longer be moved with the left/right keys.

This updates widgetset_process_keys() to call the focussed widget's
process_keys function before handling the key in any other way. All of
the widget process_keys functions correctly return false if the key is
not relevant to the widget except for textbox_process_key() which is
updated to ignore the main navigational keys.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
ui/ncurses/nc-widgets.c