Changed Family Keyboard enable toggle logic to by a configurable hot key instead of the hardcoded scroll lock key. Fixes issue #214.

This commit is contained in:
Matthew Budd 2020-10-31 20:38:44 -04:00
parent 22f47c43c6
commit 3f4d8898a0
3 changed files with 7 additions and 3 deletions

View File

@ -55,7 +55,7 @@ static const char* HotkeyStrings[HK_MAX] = {
"SelectState0", "SelectState1", "SelectState2", "SelectState3",
"SelectState4", "SelectState5", "SelectState6", "SelectState7",
"SelectState8", "SelectState9", "SelectStateNext", "SelectStatePrev",
"VolumeDown", "VolumeUp" };
"VolumeDown", "VolumeUp", "FKB_Enable" };
const char *getHotkeyString( int i )
{
@ -433,7 +433,10 @@ InitConfig()
SDLK_0, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5,
SDLK_6, SDLK_7, SDLK_8, SDLK_9,
SDLK_PAGEUP, // select state next
SDLK_PAGEDOWN}; // select state prev
SDLK_PAGEDOWN, // select state prev
0, // Volume Up Internal
0, // Volume Down Internal
SDLK_SCROLLLOCK }; // FKB Enable Toggle
prefix = "SDL.Hotkeys.";
for(int i=0; i < HK_MAX; i++)

View File

@ -20,6 +20,7 @@ enum HOTKEY { HK_CHEAT_MENU=0, HK_BIND_STATE, HK_LOAD_LUA, HK_TOGGLE_BG,
HK_SELECT_STATE_4, HK_SELECT_STATE_5, HK_SELECT_STATE_6, HK_SELECT_STATE_7,
HK_SELECT_STATE_8, HK_SELECT_STATE_9,
HK_SELECT_STATE_NEXT, HK_SELECT_STATE_PREV, HK_VOLUME_DOWN, HK_VOLUME_UP,
HK_FKB_ENABLE,
HK_MAX};
const char *getHotkeyString( int i );

View File

@ -446,7 +446,7 @@ static void KeyboardCommands (void)
// check if the family keyboard is enabled
if (CurInputType[2] == SIFC_FKB)
{
if ( g_keyState[SDL_SCANCODE_SCROLLLOCK] )
if (_keyonly (Hotkeys[HK_FKB_ENABLE]))
{
g_fkbEnabled ^= 1;
FCEUI_DispMessage ("Family Keyboard %sabled.", 0,