Signaling F12 key should be passed to core - framework/core menu should use F12+(L/R)GUI kye modifier (#1084)

This commit is contained in:
PetrM1
2026-01-13 15:18:11 +01:00
committed by GitHub
parent abfc731add
commit cf4ada2fa8
2 changed files with 10 additions and 1 deletions

View File

@@ -1095,6 +1095,12 @@ void MakeFile(const char *filename, const char *data)
fclose(file);
}
uint16_t f12_mod;
char is_f12_mod_needed()
{
return (is_x86() || is_pcxt() || is_archie() || (f12_mod != 0));
}
int GetUARTMode()
{
struct stat filestat;
@@ -1672,6 +1678,8 @@ void user_io_init(const char *path, const char *xml)
SetMidiLinkMode(midilink);
SetUARTMode(uartmode);
f12_mod = spi_uio_cmd(UIO_GET_F12_MOD);
if (!mgl_get()->count || is_menu() || is_st() || is_archie() || user_io_core_type() == CORE_TYPE_SHARPMZ)
{
mgl_get()->done = 1;
@@ -4091,7 +4099,7 @@ void user_io_kbd(uint16_t key, int press)
{
if (is_menu() && !video_fb_state()) printf("PS2 code(make)%s for core: %d(0x%X)\n", (code & EXT) ? "(ext)" : "", code & 255, code & 255);
if (!osd_is_visible && !is_menu() && key == KEY_MENU && press == 3) open_joystick_setup();
else if ((has_menu() || osd_is_visible || (get_key_mod() & (LALT | RALT | RGUI | LGUI))) && (((key == KEY_F12) && ((!is_x86() && !is_pcxt() && !is_archie()) || (get_key_mod() & (RGUI | LGUI)))) || key == KEY_MENU))
else if ((has_menu() || osd_is_visible || (get_key_mod() & (LALT | RALT | RGUI | LGUI))) && (((key == KEY_F12) && (!is_f12_mod_needed() || (get_key_mod() & (RGUI | LGUI)))) || key == KEY_MENU))
{
block_F12 = 1;
if (press == 1) menu_key_set(KEY_F12);

View File

@@ -74,6 +74,7 @@
#define UIO_GET_FB_PAR 0x40
#define UIO_SET_YC_PAR 0x41
#define UIO_GET_FR_CNT 0x42 // get frame counter
#define UIO_GET_F12_MOD 0x43 // get framework menu key modifier
// codes as used by 8bit for file loading from OSD
#define FIO_FILE_TX 0x53