|
|
@@ -22,6 +22,8 @@ namespace Ryujinx
|
|
|
|
|
|
private IGalRenderer _renderer;
|
|
|
|
|
|
+ private HidHotkeyButtons _prevHotkeyButtons = 0;
|
|
|
+
|
|
|
private KeyboardState? _keyboard = null;
|
|
|
|
|
|
private MouseState? _mouse = null;
|
|
|
@@ -128,6 +130,7 @@ namespace Ryujinx
|
|
|
|
|
|
private new void UpdateFrame()
|
|
|
{
|
|
|
+ HidHotkeyButtons currentHotkeyButtons = 0;
|
|
|
HidControllerButtons currentButton = 0;
|
|
|
HidJoystickPosition leftJoystick;
|
|
|
HidJoystickPosition rightJoystick;
|
|
|
@@ -142,10 +145,10 @@ namespace Ryujinx
|
|
|
{
|
|
|
KeyboardState keyboard = _keyboard.Value;
|
|
|
|
|
|
- currentButton = Configuration.Instance.KeyboardControls.GetButtons(keyboard);
|
|
|
-
|
|
|
- (leftJoystickDx, leftJoystickDy) = Configuration.Instance.KeyboardControls.GetLeftStick(keyboard);
|
|
|
+ currentHotkeyButtons = Configuration.Instance.KeyboardControls.GetHotkeyButtons(keyboard);
|
|
|
+ currentButton = Configuration.Instance.KeyboardControls.GetButtons(keyboard);
|
|
|
|
|
|
+ (leftJoystickDx, leftJoystickDy) = Configuration.Instance.KeyboardControls.GetLeftStick(keyboard);
|
|
|
(rightJoystickDx, rightJoystickDy) = Configuration.Instance.KeyboardControls.GetRightStick(keyboard);
|
|
|
}
|
|
|
|
|
|
@@ -238,6 +241,15 @@ namespace Ryujinx
|
|
|
HidControllerBase controller = _device.Hid.PrimaryController;
|
|
|
|
|
|
controller.SendInput(currentButton, leftJoystick, rightJoystick);
|
|
|
+
|
|
|
+ // Toggle vsync
|
|
|
+ if (currentHotkeyButtons.HasFlag(HidHotkeyButtons.ToggleVSync) &&
|
|
|
+ !_prevHotkeyButtons.HasFlag(HidHotkeyButtons.ToggleVSync))
|
|
|
+ {
|
|
|
+ _device.EnableDeviceVsync = !_device.EnableDeviceVsync;
|
|
|
+ }
|
|
|
+
|
|
|
+ _prevHotkeyButtons = currentHotkeyButtons;
|
|
|
}
|
|
|
|
|
|
private new void RenderFrame()
|