Pass F12 to core if OSD is disabled.

This commit is contained in:
sorgelig
2017-10-03 04:31:04 +08:00
parent 72b4d1b61d
commit 18cb09749d
3 changed files with 12 additions and 3 deletions

2
menu.c
View File

@@ -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();

View File

@@ -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);

View File

@@ -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();