Add Direct Mouse Support (#2374)

* and direct mouse support

* and direct mouse support

* hide cursor if mouse enabled

* add config

* update docs

* sorted usings
This commit is contained in:
emmauss 2021-06-24 00:09:08 +00:00 committed by GitHub
parent a10b2c5ff2
commit 77aab9aca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 200 additions and 32 deletions

View file

@ -268,6 +268,11 @@ namespace Ryujinx.Configuration
/// Enable or disable keyboard support (Independent from controllers binding)
/// </summary>
public ReactiveObject<bool> EnableKeyboard { get; private set; }
/// <summary>
/// Enable or disable mouse support (Independent from controllers binding)
/// </summary>
public ReactiveObject<bool> EnableMouse { get; private set; }
/// <summary>
/// Hotkey Keyboard Bindings
@ -284,6 +289,7 @@ namespace Ryujinx.Configuration
public HidSection()
{
EnableKeyboard = new ReactiveObject<bool>();
EnableMouse = new ReactiveObject<bool>();
Hotkeys = new ReactiveObject<KeyboardHotkeys>();
InputConfig = new ReactiveObject<List<InputConfig>>();
}
@ -471,6 +477,7 @@ namespace Ryujinx.Configuration
CustomThemePath = Ui.CustomThemePath,
StartFullscreen = Ui.StartFullscreen,
EnableKeyboard = Hid.EnableKeyboard,
EnableMouse = Hid.EnableMouse,
Hotkeys = Hid.Hotkeys,
KeyboardConfig = new List<object>(),
ControllerConfig = new List<object>(),
@ -532,6 +539,7 @@ namespace Ryujinx.Configuration
Ui.CustomThemePath.Value = "";
Ui.StartFullscreen.Value = false;
Hid.EnableKeyboard.Value = false;
Hid.EnableMouse.Value = false;
Hid.Hotkeys.Value = new KeyboardHotkeys
{
ToggleVsync = Key.Tab
@ -828,6 +836,15 @@ namespace Ryujinx.Configuration
configurationFileUpdated = true;
}
if (configurationFileFormat.Version < 27)
{
Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 27.");
configurationFileFormat.EnableMouse = false;
configurationFileUpdated = true;
}
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
Graphics.ResScale.Value = configurationFileFormat.ResScale;
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
@ -878,6 +895,7 @@ namespace Ryujinx.Configuration
Ui.CustomThemePath.Value = configurationFileFormat.CustomThemePath;
Ui.StartFullscreen.Value = configurationFileFormat.StartFullscreen;
Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard;
Hid.EnableMouse.Value = configurationFileFormat.EnableMouse;
Hid.Hotkeys.Value = configurationFileFormat.Hotkeys;
Hid.InputConfig.Value = configurationFileFormat.InputConfig;