From 39d77623ff752ca394a8fa2ebc0219f41060a488 Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Sun, 6 Sep 2009 00:46:55 -0700 Subject: [PATCH] hdt: fix build due to cmenu keyboard changes Sames changes as the ones needed on the cmenu examples. Signed-off-by: Pierre-Alexandre Meyer --- com32/hdt/hdt-menu.c | 6 +++--- com32/hdt/hdt-menu.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c index 55031d6..894a7d1 100644 --- a/com32/hdt/hdt-menu.c +++ b/com32/hdt/hdt-menu.c @@ -85,18 +85,18 @@ TIMEOUTCODE ontimeout() } /* Keyboard handler for the menu system */ -void keys_handler(t_menuitem * mi, unsigned int scancode) +void keys_handler(t_menusystem * ms __attribute__ (( unused )), t_menuitem * mi, int scancode) { int nr, nc; - if ((scancode >> 8) == F1) { // If scancode of F1 + if (scancode == KEY_F1) { // If scancode of F1 runhelpsystem(mi->helpid); } /* * If user hit TAB, and item is an "executable" item * and user has privileges to edit it, edit it in place. */ - if (((scancode & 0xFF) == 0x09) && (mi->action == OPT_RUN)) { + if ((scancode == KEY_TAB) && (mi->action == OPT_RUN)) { //(isallowed(username,"editcmd") || isallowed(username,"root"))) { if (getscreensize(1, &nr, &nc)) { /* Unknown screen size? */ diff --git a/com32/hdt/hdt-menu.h b/com32/hdt/hdt-menu.h index 061fa68..f715ed0 100644 --- a/com32/hdt/hdt-menu.h +++ b/com32/hdt/hdt-menu.h @@ -29,6 +29,7 @@ #ifndef DEFINE_HDT_MENU_H #define DEFINE_HDT_MENU_H #include +#include #include "menu.h" #include "help.h" @@ -82,7 +83,7 @@ struct s_hdt_menu { }; TIMEOUTCODE ontimeout(); -void keys_handler(t_menuitem * mi, unsigned int scancode); +void keys_handler(t_menusystem * ms __attribute__ (( unused )), t_menuitem * mi, int scancode); // PCI Stuff int compute_PCI(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware); -- 2.7.4