diff --git a/src/drivers/sdl/config.cpp b/src/drivers/sdl/config.cpp index a249d74e..d8bddc62 100644 --- a/src/drivers/sdl/config.cpp +++ b/src/drivers/sdl/config.cpp @@ -26,6 +26,46 @@ #include #include +static const char* HotkeyStrings[HK_MAX] = { + "CheatMenu", + "BindState", + "LoadLua", + "ToggleBG", + "SaveState", + "FDSSelect", + "LoadState", + "FDSEject", + "VSInsertCoin", + "VSToggleDip", + "MovieToggleFrameDisplay", + "SubtitleDisplay", + "Reset", + "Screenshot", + "Pause", + "DecreaseSpeed", + "IncreaseSpeed", + "FrameAdvance", + "Turbo", + "ToggleInputDisplay", + "ToggleMovieRW", + "MuteCapture", + "Quit", + "FrameAdvanceLagSkip", + "LagCounterDisplay", + "SelectState0", "SelectState1", "SelectState2", "SelectState3", + "SelectState4", "SelectState5", "SelectState6", "SelectState7", + "SelectState8", "SelectState9", "SelectStateNext", "SelectStatePrev", + "VolumeDown", "VolumeUp" }; + +const char *getHotkeyString( int i ) +{ + if ( (i>=0) && (igetOption (optionName.c_str (), &keycode); gtk_tree_store_set (hotkey_store, &iter, 0, optionName.c_str (), 1, @@ -578,7 +578,7 @@ static gint hotKeyPressCB (GtkTreeView * tree, GdkEventKey * event, { int sdlkey = 0; std::string hotKeyName = "SDL.Hotkeys."; - hotKeyName.append (HotkeyStrings[indexArray[0]]); + hotKeyName.append ( getHotkeyString(indexArray[0]) ); // Convert this keypress from GDK to SDL. #if SDL_VERSION_ATLEAST(2, 0, 0) diff --git a/src/drivers/sdl/input.cpp b/src/drivers/sdl/input.cpp index e6782e34..38d16fe1 100644 --- a/src/drivers/sdl/input.cpp +++ b/src/drivers/sdl/input.cpp @@ -183,7 +183,7 @@ setHotKeys (void) std::string prefix = "SDL.Hotkeys."; for (int i = 0; i < HK_MAX; i++) { - g_config->getOption (prefix + HotkeyStrings[i], &Hotkeys[i]); + g_config->getOption (prefix + getHotkeyString(i), &Hotkeys[i]); } return; }