]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-menu.c
test/parser: Add pxe discovery tests
[petitboot] / ui / ncurses / nc-menu.c
index eb7cfdff0d942562333a664dfe145b4555e03e6b..cd7c54e6b67c4dde5fe39d0f613ae701fc6e568e 100644 (file)
@@ -16,9 +16,9 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#if defined(HAVE_CONFIG_H)
 #include "config.h"
-
-#define _GNU_SOURCE
+#endif
 
 #include <assert.h>
 #include <errno.h>
@@ -227,9 +227,15 @@ static void pmenu_process_key(struct nc_scr *scr, int key)
        case KEY_UP:
                pmenu_move_cursor(menu, REQ_UP_ITEM);
                break;
+       case KEY_BTAB:
+               pmenu_move_cursor(menu, REQ_PREV_ITEM);
+               break;
        case KEY_DOWN:
                pmenu_move_cursor(menu, REQ_DOWN_ITEM);
                break;
+       case '\t':
+               pmenu_move_cursor(menu, REQ_NEXT_ITEM);
+               break;
        case 'e':
                if (item->on_edit)
                        item->on_edit(item);
@@ -250,6 +256,12 @@ static void pmenu_process_key(struct nc_scr *scr, int key)
        case 'c':
                cui_show_config(cui_from_arg(scr->ui_ctx));
                break;
+       case KEY_F(1):
+       case 'h':
+               if (menu->help_text)
+                       cui_show_help(cui_from_arg(scr->ui_ctx),
+                                       menu->help_title, menu->help_text);
+               break;
        default:
                menu_driver(menu->ncm, key);
                break;