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.
|
// When we have reached the end of the list, trigger UI_mode unlock.
|
||||||
void UIModeController::unlockUIMode()
|
void UIModeController::unlockUIMode()
|
||||||
{
|
{
|
||||||
LOG(LogDebug) <<
|
LOG(LogInfo) << "Passkey sequence completed, switching UI mode to Full";
|
||||||
" UIModeController::listen(): Passkey sequence completed, switching UIMode to Full";
|
|
||||||
Settings::getInstance()->setString("UIMode", "full");
|
Settings::getInstance()->setString("UIMode", "full");
|
||||||
Settings::getInstance()->saveFile();
|
Settings::getInstance()->saveFile();
|
||||||
mPassKeyCounter = 0;
|
mPassKeyCounter = 0;
|
||||||
|
@ -138,10 +137,18 @@ std::string UIModeController::getFormattedPassKeyStr()
|
||||||
|
|
||||||
bool UIModeController::isValidInput(InputConfig* config, Input input)
|
bool UIModeController::isValidInput(InputConfig* config, Input input)
|
||||||
{
|
{
|
||||||
if ((config->getMappedTo(input).size() == 0) || // Not a mapped input, so ignore..
|
if ((config->getMappedTo(input).size() == 0) || // Not a mapped input, so ignore it.
|
||||||
(input.type == TYPE_HAT) || // Ignore all hat inputs.
|
|
||||||
(!input.value)) // Not a key-down event.
|
(!input.value)) // Not a key-down event.
|
||||||
return false;
|
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
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue