]> git.ozlabs.org Git - petitboot/commitdiff
ui/ncurses: Define Home, End, and Page Up/Down keys
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Thu, 16 Apr 2015 01:53:20 +0000 (11:53 +1000)
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Wed, 22 Apr 2015 00:10:43 +0000 (10:10 +1000)
ui/ncurses/nc-cui.c

index 3f1e0a265176c0377315448d6398a074ea6ae88f..8e31fe2a2a6ca5dff800f730a1deff8ee9088f5e 100644 (file)
@@ -69,6 +69,16 @@ static void cui_start(void)
         */
        define_key("\x1b[Z", KEY_BTAB);
 
         */
        define_key("\x1b[Z", KEY_BTAB);
 
+       /* We'll define a few other keys too since they're commonly
+        * used for navigation but the escape character will cause
+        * Petitboot to exit if they're left undefined */
+       define_key("\x1b\x5b\x35\x7e", KEY_PPAGE);
+       define_key("\x1b\x5b\x36\x7e", KEY_NPAGE);
+       define_key("\x1b\x4f\x48", KEY_HOME);
+       define_key("\x1b\x4f\x46", KEY_END);
+       define_key("OH", KEY_HOME);
+       define_key("OF", KEY_END);
+
        while (getch() != ERR)          /* flush stdin */
                (void)0;
 }
        while (getch() != ERR)          /* flush stdin */
                (void)0;
 }