gtk: set Pause key as an accelerator and don't send the keypress event to SDL
Now the Pause/Resume menu item changes state when the emulator is paused or unpaused using the Pause key.
This commit is contained in:
parent
d8f4c3636c
commit
a7c16f1835
|
@ -1768,6 +1768,9 @@ unsigned short GDKToSDLKeyval(int gdk_key)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore Pause hotkey since it is handled by GTK+ as an accelerator
|
||||||
|
if (sdl_key == Hotkeys[HK_PAUSE]) return 0;
|
||||||
|
|
||||||
return sdl_key;
|
return sdl_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1902,7 +1905,7 @@ static GtkActionEntry normal_entries[] = {
|
||||||
{"EmulatorMenuAction", NULL, "_Emulator"},
|
{"EmulatorMenuAction", NULL, "_Emulator"},
|
||||||
{"PowerAction", NULL, "P_ower", NULL, NULL, G_CALLBACK(FCEUI_PowerNES)},
|
{"PowerAction", NULL, "P_ower", NULL, NULL, G_CALLBACK(FCEUI_PowerNES)},
|
||||||
{"ResetAction", GTK_STOCK_REFRESH, "_Reset", NULL, NULL, G_CALLBACK(emuReset)},
|
{"ResetAction", GTK_STOCK_REFRESH, "_Reset", NULL, NULL, G_CALLBACK(emuReset)},
|
||||||
{"PauseToggleAction", GTK_STOCK_MEDIA_PAUSE, "_Pause", NULL, NULL, G_CALLBACK(togglePause)},
|
{"PauseToggleAction", GTK_STOCK_MEDIA_PAUSE, "_Pause", "Pause", NULL, G_CALLBACK(togglePause)},
|
||||||
{"FdsMenuAction", GTK_STOCK_FLOPPY, "_FDS"},
|
{"FdsMenuAction", GTK_STOCK_FLOPPY, "_FDS"},
|
||||||
{"SwitchDiskAction", "go-jump", "_Switch Disk", NULL, NULL, G_CALLBACK(FCEU_FDSSelect)},
|
{"SwitchDiskAction", "go-jump", "_Switch Disk", NULL, NULL, G_CALLBACK(FCEU_FDSSelect)},
|
||||||
{"EjectDiskAction", "media-eject", "_Eject Disk", NULL, NULL, G_CALLBACK(FCEU_FDSInsert)},
|
{"EjectDiskAction", "media-eject", "_Eject Disk", NULL, NULL, G_CALLBACK(FCEU_FDSInsert)},
|
||||||
|
|
|
@ -14,6 +14,7 @@ typedef struct {
|
||||||
|
|
||||||
extern CFGSTRUCT InputConfig[];
|
extern CFGSTRUCT InputConfig[];
|
||||||
extern ARGPSTRUCT InputArgs[];
|
extern ARGPSTRUCT InputArgs[];
|
||||||
|
extern int Hotkeys[];
|
||||||
void ParseGIInput(FCEUGI *GI);
|
void ParseGIInput(FCEUGI *GI);
|
||||||
void setHotKeys();
|
void setHotKeys();
|
||||||
int ButtonConfigBegin();
|
int ButtonConfigBegin();
|
||||||
|
|
Loading…
Reference in New Issue