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:
plombo 2011-03-19 01:44:13 +00:00
parent d8f4c3636c
commit a7c16f1835
2 changed files with 5 additions and 1 deletions
src/drivers/sdl

View File

@ -1768,6 +1768,9 @@ unsigned short GDKToSDLKeyval(int gdk_key)
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;
}
@ -1902,7 +1905,7 @@ static GtkActionEntry normal_entries[] = {
{"EmulatorMenuAction", NULL, "_Emulator"},
{"PowerAction", NULL, "P_ower", NULL, NULL, G_CALLBACK(FCEUI_PowerNES)},
{"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"},
{"SwitchDiskAction", "go-jump", "_Switch Disk", NULL, NULL, G_CALLBACK(FCEU_FDSSelect)},
{"EjectDiskAction", "media-eject", "_Eject Disk", NULL, NULL, G_CALLBACK(FCEU_FDSInsert)},

View File

@ -14,6 +14,7 @@ typedef struct {
extern CFGSTRUCT InputConfig[];
extern ARGPSTRUCT InputArgs[];
extern int Hotkeys[];
void ParseGIInput(FCEUGI *GI);
void setHotKeys();
int ButtonConfigBegin();