This maintains backwards-support for the CTRL key functions, but also
adds regular key functions for the platforms that do not process the
CTRL key. These new keys are ESC and DELETE, and are meaningful.

Signed-off-by: Michael J. Bazzinotti <mbazzino...@gmail.com>
---
 src/hci/tui/settings_ui.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/hci/tui/settings_ui.c b/src/hci/tui/settings_ui.c
index be421cc..6cb2756 100644
--- a/src/hci/tui/settings_ui.c
+++ b/src/hci/tui/settings_ui.c
@@ -384,12 +384,12 @@ static void draw_instruction_row ( struct settings_ui *ui 
) {
        if ( ui->row.editing ) {
                msg ( INSTRUCTION_ROW,
                      "Enter - accept changes" INSTRUCTION_PAD
-                     "Ctrl-C - discard changes" );
+                     "ESC - discard changes" );
        } else {
                msg ( INSTRUCTION_ROW,
-                     "%sCtrl-X - exit configuration utility",
+                     "%sESC - exit configuration utility",
                      ( ( ui->row.origin == ui->settings ) ?
-                       "Ctrl-D - delete setting" INSTRUCTION_PAD : "" ) );
+                       "BACKSPACE - delete setting" INSTRUCTION_PAD : "" ) );
        }
 }
 
@@ -486,6 +486,7 @@ static int main_loop ( struct settings *settings ) {
                                if ( ( rc = save_setting ( &ui ) ) != 0 )
                                        alert ( " %s ", strerror ( rc ) );
                                /* Fall through */
+                       case ESC:
                        case CTRL_C:
                                select_setting_row ( &ui, ui.scroll.current );
                                redraw = 1;
@@ -516,6 +517,7 @@ static int main_loop ( struct settings *settings ) {
 
                /* Handle non-navigation keys */
                switch ( key ) {
+               case BACKSPACE:
                case CTRL_D:
                        if ( ! ui.row.setting.name )
                                break;
@@ -526,6 +528,7 @@ static int main_loop ( struct settings *settings ) {
                        select_setting_row ( &ui, ui.scroll.current );
                        redraw = 1;
                        break;
+               case ESC:
                case CTRL_X:
                        return 0;
                case CR:
-- 
2.3.6

_______________________________________________
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel

Reply via email to