]> git.ozlabs.org Git - petitboot/commitdiff
ui/ncurses: Use 'x' as exit key
authorJeremy Kerr <jk@ozlabs.org>
Fri, 11 Oct 2013 07:16:39 +0000 (15:16 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 11 Oct 2013 07:16:39 +0000 (15:16 +0800)
Because terminals will send escape-sequences starting with escape,
ncurses will pause after receiving a signle escape, to detect
these sequences. This introduces a 1-second delay when exiting the
petitboot UI.

Instead, use 'x'.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ui/ncurses/generic-main.c
ui/ncurses/nc-cui.c
ui/ncurses/nc-menu.c
ui/ncurses/ps3-main.c

index d9fd7d2d0415349d05c89a766a15d7e9c17a2449..49a96cb0037f108a7e5b76228877638b04520ab4 100644 (file)
@@ -149,7 +149,7 @@ static struct pmenu *pb_mm_init(struct pb_cui *pb_cui)
                "Petitboot (" PACKAGE_VERSION ")");
        m->scr.frame.rtitle = NULL;
        m->scr.frame.help = talloc_strdup(m,
-               "ESC=exit, Enter=accept, e=edit, n=new");
+               "Enter=accept, e=edit, n=new, x=exit");
        m->scr.frame.status = talloc_strdup(m, "Welcome to Petitboot");
 
        i = pmenu_item_init(m, 0, "Exit to Shell");
index 33a9f73e81b966f50e2a11a1793edb94be3c3793..da97fd9b21ae9e2e1f0bfcf61d470935bd3f4afe 100644 (file)
@@ -65,7 +65,7 @@ void cui_resize(struct cui *cui)
 }
 
 /**
- * cui_on_exit - A generic main menu ESC callback.
+ * cui_on_exit - A generic main menu exit callback.
  */
 
 void cui_on_exit(struct pmenu *menu)
index b45719d53ae23266a1fac39d8199117f8dc8bc09..beb63f3bdd2f91b3bf7fc9d4a18161c872bb6958 100644 (file)
@@ -205,6 +205,7 @@ static void pmenu_process_key(struct nc_scr *scr, int key)
 
        switch (key) {
        case 27: /* ESC */
+       case 'x':
                if (menu->on_exit)
                        menu->on_exit(menu);
                nc_flush_keys();
index 9efba3bd8b5079122f24cffa7c81d42b1e18d3bb..c4a3892887b3f212130b9a630c5aa91b329d451d 100644 (file)
@@ -343,7 +343,7 @@ static int ps3_svm_to_mm_cb(struct pmenu_item *item)
 }
 
 /**
- * ps3_svm_to_mm_helper - The svm ESC callback.
+ * ps3_svm_to_mm_helper - The svm exit callback.
  */
 
 static void ps3_svm_to_mm_helper(struct pmenu *menu)
@@ -421,7 +421,7 @@ static struct pmenu *ps3_mm_init(struct ps3_cui *ps3_cui)
        m->scr.frame.title = talloc_strdup(m, "Petitboot PS3");
 #endif
        m->scr.frame.help = talloc_strdup(m,
-               "ESC=exit, Enter=accept, e=edit, o=open");
+               "Enter=accept, e=edit, o=open, x=exit");
        m->scr.frame.status = talloc_strdup(m, "Welcome to Petitboot");
 
        i = pmenu_item_init(m, 0, "Boot GameOS");
@@ -472,7 +472,7 @@ static struct pmenu *ps3_svm_init(struct ps3_cui *ps3_cui)
 
        m->hot_key = ps3_hot_key;
        m->scr.frame.title = talloc_strdup(m, "Select PS3 Video Mode");
-       m->scr.frame.help = talloc_strdup(m, "ESC=exit, Enter=accept");
+       m->scr.frame.help = talloc_strdup(m, "Enter=accept, x=exit");
 
        i = pmenu_item_init(m, 0, "auto detect");
        i->on_execute = ps3_svm_cb;