mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Made it possible to use the controller hat when entering the UI mode passkey.
This commit is contained in:
parent
9909260480
commit
045e66103a
|
@ -72,8 +72,7 @@ bool UIModeController::inputIsMatch(InputConfig* config, Input input)
|
|||
// When we have reached the end of the list, trigger UI_mode unlock.
|
||||
void UIModeController::unlockUIMode()
|
||||
{
|
||||
LOG(LogDebug) <<
|
||||
" UIModeController::listen(): Passkey sequence completed, switching UIMode to Full";
|
||||
LOG(LogInfo) << "Passkey sequence completed, switching UI mode to Full";
|
||||
Settings::getInstance()->setString("UIMode", "full");
|
||||
Settings::getInstance()->saveFile();
|
||||
mPassKeyCounter = 0;
|
||||
|
@ -138,10 +137,18 @@ std::string UIModeController::getFormattedPassKeyStr()
|
|||
|
||||
bool UIModeController::isValidInput(InputConfig* config, Input input)
|
||||
{
|
||||
if ((config->getMappedTo(input).size() == 0) || // Not a mapped input, so ignore..
|
||||
(input.type == TYPE_HAT) || // Ignore all hat inputs.
|
||||
if ((config->getMappedTo(input).size() == 0) || // Not a mapped input, so ignore it.
|
||||
(!input.value)) // Not a key-down event.
|
||||
return false;
|
||||
else if (input.type == TYPE_HAT) {
|
||||
// When the hat goes back to neutral, getMappedTo() will return entries for all
|
||||
// four directions as the neutral cancels any of them out. So a neutral is
|
||||
// equivalent to a key-up event and should therefore be ignored.
|
||||
if (config->getMappedTo(input).size() == 4)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue