diff --git a/menu.c b/menu.c index eafded0..fa8ce64 100644 --- a/menu.c +++ b/menu.c @@ -462,7 +462,7 @@ static uint32_t menu_key_get(void) } // currently no key pressed - if (!c) + if (!c && has_menu()) { static unsigned char last_but = 0; unsigned char but = user_io_menu_button(); diff --git a/user_io.c b/user_io.c index f95fcd1..2c68f79 100644 --- a/user_io.c +++ b/user_io.c @@ -143,10 +143,18 @@ char is_x86_core() return (is_x86_type == 1); } +static int is_no_type = 0; +char has_menu() +{ + if (!is_no_type) is_no_type = core_name[0] ? 1 : 2; + return (is_no_type == 1); +} + static void user_io_read_core_name() { is_menu_type = 0; is_x86_type = 0; + is_no_type = 0; core_name[0] = 0; if (user_io_is_8bit_with_config_string()) @@ -1701,7 +1709,7 @@ void user_io_kbd(uint16_t key, int press) if (osd_is_visible) { - if(key == KEY_MENU) menu_key_set(UPSTROKE | KEY_F12); + if(key == KEY_MENU && has_menu()) menu_key_set(UPSTROKE | KEY_F12); else menu_key_set(UPSTROKE | key); } @@ -1712,7 +1720,7 @@ void user_io_kbd(uint16_t key, int press) { if (is_menu_core()) printf("PS2 code(make)%s for core: %d(0x%X)\n", (code & EXT) ? "(ext)" : "", code & 255, code & 255); - if (((key == KEY_F12) && (!is_x86_core() || (get_key_mod() & (RGUI | LGUI)))) || key == KEY_MENU) menu_key_set(KEY_F12); + if (has_menu() && (((key == KEY_F12) && (!is_x86_core() || (get_key_mod() & (RGUI | LGUI)))) || key == KEY_MENU)) menu_key_set(KEY_F12); else if (osd_is_visible) { if (press == 1) menu_key_set(key); diff --git a/user_io.h b/user_io.h index f003135..f8ace90 100644 --- a/user_io.h +++ b/user_io.h @@ -175,6 +175,7 @@ char *user_io_get_core_name(); char *user_io_get_core_name_ex(); char is_menu_core(); char is_x86_core(); +char has_menu(); emu_mode_t user_io_get_kbdemu();