diff --git a/RetroFE/Source/Control/UserInput.cpp b/RetroFE/Source/Control/UserInput.cpp index 2803b1d..f5ea24a 100644 --- a/RetroFE/Source/Control/UserInput.cpp +++ b/RetroFE/Source/Control/UserInput.cpp @@ -51,8 +51,8 @@ bool UserInput::Initialize() retVal = MapKey("pageDown", KeyCodePageDown) && retVal; retVal = MapKey("pageUp", KeyCodePageUp) && retVal; retVal = MapKey("letterDown", KeyCodeLetterDown) && retVal; - retVal = MapKey("letterUp", KeyCodeLetterUp) && retVal; - retVal = MapKey("select", KeyCodeSelect) && retVal; + MapKey("letterUp", KeyCodeLetterUp); + MapKey("select", KeyCodeSelect); retVal = MapKey("back", KeyCodeBack) && retVal; retVal = MapKey("quit", KeyCodeQuit) && retVal; // these features will need to be implemented at a later time @@ -128,19 +128,18 @@ bool UserInput::MapKey(std::string keyDescription, KeyCode_E key) bool UserInput::SetKeyState(SDL_Scancode code, bool state) { - KeyCode_E key = GetKeycode(code); + KeyCode_E key = GetKeycode(code); - if(key == KeyCodeNull) - { - return false; - } + if(key == KeyCodeNull) { return false; } + if(KeyState.find(key) == KeyState.end()) { return false; } - KeyState[key] = state; - return true; + KeyState[key] = state; + return true; } bool UserInput::GetKeyState(KeyCode_E key) { + if(KeyState.find(key) == KeyState.end()) { return false; } return KeyState[key]; } diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index c268c0b..bee99f4 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -419,7 +419,7 @@ RetroFE::RETROFE_STATE RetroFE::ProcessUserInput(Page *page) } if (Input.GetKeyState(UserInput::KeyCodeDown)) { - page->SetScrolling(Page::ScrollDirectionForward); + page->SetScrolling(Page::ScrollDirectionForward); } } if (Input.GetKeyState(UserInput::KeyCodePageUp))