Hide UI rework/arrow key fix (#2504)

* Unbreak arrow keys

* Use bitshift for Flags instead of literal
This commit is contained in:
ooa113y 2021-08-05 00:28:19 +03:00 committed by GitHub
parent 5ceaf344ce
commit 46ffc81d90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 21 deletions

View file

@ -568,6 +568,12 @@ namespace Ryujinx.Ui
Renderer.Screenshot();
}
if (currentHotkeyState.HasFlag(KeyboardHotkeyState.ShowUi) &&
!_prevHotkeyState.HasFlag(KeyboardHotkeyState.ShowUi))
{
(Toplevel as MainWindow).ToggleExtraWidgets(true);
}
_prevHotkeyState = currentHotkeyState;
}
@ -593,9 +599,10 @@ namespace Ryujinx.Ui
[Flags]
private enum KeyboardHotkeyState
{
None,
ToggleVSync,
Screenshot
None = 0,
ToggleVSync = 1 << 0,
Screenshot = 1 << 1,
ShowUi = 1 << 2
}
private KeyboardHotkeyState GetHotkeyState()
@ -612,6 +619,11 @@ namespace Ryujinx.Ui
state |= KeyboardHotkeyState.Screenshot;
}
if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ShowUi))
{
state |= KeyboardHotkeyState.ShowUi;
}
return state;
}
}