Fix exiting emulation mode with ENTER (GPIO) button;

pressing the button would exit emulation mode, but then releasing the button would immediately enter it again.
Logic copied from CheckButtonsBrowseMode().
This commit is contained in:
Rembrand van Lakwijk 2019-09-10 17:54:37 +02:00
parent c71fe6e1dc
commit 4a8ba25d8c

View file

@ -139,16 +139,20 @@ void InputMappings::CheckButtonsEmulationMode()
{ {
buttonFlags = 0; buttonFlags = 0;
if (IEC_Bus::GetInputButtonPressed(INPUT_BUTTON_ENTER)) if (IEC_Bus::GetInputButtonRepeating(INPUT_BUTTON_UP))
SetButtonFlag(ESC_FLAG);
else if (IEC_Bus::GetInputButtonPressed(INPUT_BUTTON_UP))
SetButtonFlag(NEXT_FLAG); SetButtonFlag(NEXT_FLAG);
else if (IEC_Bus::GetInputButtonPressed(INPUT_BUTTON_DOWN)) else if (IEC_Bus::GetInputButtonRepeating(INPUT_BUTTON_DOWN))
SetButtonFlag(PREV_FLAG); SetButtonFlag(PREV_FLAG);
//else if (IEC_Bus::GetInputButtonPressed(INPUT_BUTTON_BACK)) //else if (IEC_Bus::GetInputButtonPressed(INPUT_BUTTON_BACK))
// SetButtonFlag(BACK_FLAG); // SetButtonFlag(BACK_FLAG);
//else if (IEC_Bus::GetInputButtonPressed(INPUT_BUTTON_INSERT)) //else if (IEC_Bus::GetInputButtonPressed(INPUT_BUTTON_INSERT))
// SetButtonFlag(INSERT_FLAG); // SetButtonFlag(INSERT_FLAG);
else {
enterButtonPressed = !IEC_Bus::GetInputButtonReleased(INPUT_BUTTON_ENTER);
if (enterButtonPressedPrev && !enterButtonPressed)
SetButtonFlag(ESC_FLAG);
enterButtonPressedPrev = enterButtonPressed;
}
} }