Add Motion controls (#1363)

* Add motion controls

Apply suggestions from code review

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* cleanup

* add reference orientation and derive relative orientation from it

* cleanup

* remove unused variable and strange file

* Review_2.

* change GetInput to TryGetInput

* Review_3.

Co-authored-by: Ac_K <Acoustik666@gmail.com>
Co-authored-by: LDj3SNuD <dvitiello@gmail.com>
This commit is contained in:
emmauss 2020-09-29 21:32:42 +00:00 committed by GitHub
parent a6f8a0b01e
commit 26319d5ab3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 1780 additions and 63 deletions

View file

@ -28,10 +28,19 @@ namespace Ryujinx.Ui
[GUI] Adjustment _controllerDeadzoneLeft;
[GUI] Adjustment _controllerDeadzoneRight;
[GUI] Adjustment _controllerTriggerThreshold;
[GUI] Adjustment _slotNumber;
[GUI] Adjustment _altSlotNumber;
[GUI] Adjustment _sensitivity;
[GUI] Adjustment _gyroDeadzone;
[GUI] CheckButton _enableMotion;
[GUI] CheckButton _mirrorInput;
[GUI] Entry _dsuServerHost;
[GUI] Entry _dsuServerPort;
[GUI] ComboBoxText _inputDevice;
[GUI] ComboBoxText _profile;
[GUI] ToggleButton _refreshInputDevicesButton;
[GUI] Box _settingsBox;
[GUI] Box _altBox;
[GUI] Grid _leftStickKeyboard;
[GUI] Grid _leftStickController;
[GUI] Box _deadZoneLeftBox;
@ -225,6 +234,7 @@ namespace Ryujinx.Ui
{
_leftSideTriggerBox.Hide();
_rightSideTriggerBox.Hide();
_altBox.Hide();
switch (_controllerType.ActiveId)
{
@ -234,6 +244,9 @@ namespace Ryujinx.Ui
case "JoyconRight":
_rightSideTriggerBox.Show();
break;
case "JoyconPair":
_altBox.Show();
break;
}
switch (_controllerType.ActiveId)
@ -290,6 +303,14 @@ namespace Ryujinx.Ui
_controllerDeadzoneLeft.Value = 0;
_controllerDeadzoneRight.Value = 0;
_controllerTriggerThreshold.Value = 0;
_mirrorInput.Active = false;
_enableMotion.Active = false;
_slotNumber.Value = 0;
_altSlotNumber.Value = 0;
_sensitivity.Value = 100;
_gyroDeadzone.Value = 1;
_dsuServerHost.Buffer.Text = "";
_dsuServerPort.Buffer.Text = "";
}
private void SetValues(InputConfig config)
@ -304,34 +325,42 @@ namespace Ryujinx.Ui
: ControllerType.ProController.ToString());
}
_lStickUp.Label = keyboardConfig.LeftJoycon.StickUp.ToString();
_lStickDown.Label = keyboardConfig.LeftJoycon.StickDown.ToString();
_lStickLeft.Label = keyboardConfig.LeftJoycon.StickLeft.ToString();
_lStickRight.Label = keyboardConfig.LeftJoycon.StickRight.ToString();
_lStickButton.Label = keyboardConfig.LeftJoycon.StickButton.ToString();
_dpadUp.Label = keyboardConfig.LeftJoycon.DPadUp.ToString();
_dpadDown.Label = keyboardConfig.LeftJoycon.DPadDown.ToString();
_dpadLeft.Label = keyboardConfig.LeftJoycon.DPadLeft.ToString();
_dpadRight.Label = keyboardConfig.LeftJoycon.DPadRight.ToString();
_minus.Label = keyboardConfig.LeftJoycon.ButtonMinus.ToString();
_l.Label = keyboardConfig.LeftJoycon.ButtonL.ToString();
_zL.Label = keyboardConfig.LeftJoycon.ButtonZl.ToString();
_lSl.Label = keyboardConfig.LeftJoycon.ButtonSl.ToString();
_lSr.Label = keyboardConfig.LeftJoycon.ButtonSr.ToString();
_rStickUp.Label = keyboardConfig.RightJoycon.StickUp.ToString();
_rStickDown.Label = keyboardConfig.RightJoycon.StickDown.ToString();
_rStickLeft.Label = keyboardConfig.RightJoycon.StickLeft.ToString();
_rStickRight.Label = keyboardConfig.RightJoycon.StickRight.ToString();
_rStickButton.Label = keyboardConfig.RightJoycon.StickButton.ToString();
_a.Label = keyboardConfig.RightJoycon.ButtonA.ToString();
_b.Label = keyboardConfig.RightJoycon.ButtonB.ToString();
_x.Label = keyboardConfig.RightJoycon.ButtonX.ToString();
_y.Label = keyboardConfig.RightJoycon.ButtonY.ToString();
_plus.Label = keyboardConfig.RightJoycon.ButtonPlus.ToString();
_r.Label = keyboardConfig.RightJoycon.ButtonR.ToString();
_zR.Label = keyboardConfig.RightJoycon.ButtonZr.ToString();
_rSl.Label = keyboardConfig.RightJoycon.ButtonSl.ToString();
_rSr.Label = keyboardConfig.RightJoycon.ButtonSr.ToString();
_lStickUp.Label = keyboardConfig.LeftJoycon.StickUp.ToString();
_lStickDown.Label = keyboardConfig.LeftJoycon.StickDown.ToString();
_lStickLeft.Label = keyboardConfig.LeftJoycon.StickLeft.ToString();
_lStickRight.Label = keyboardConfig.LeftJoycon.StickRight.ToString();
_lStickButton.Label = keyboardConfig.LeftJoycon.StickButton.ToString();
_dpadUp.Label = keyboardConfig.LeftJoycon.DPadUp.ToString();
_dpadDown.Label = keyboardConfig.LeftJoycon.DPadDown.ToString();
_dpadLeft.Label = keyboardConfig.LeftJoycon.DPadLeft.ToString();
_dpadRight.Label = keyboardConfig.LeftJoycon.DPadRight.ToString();
_minus.Label = keyboardConfig.LeftJoycon.ButtonMinus.ToString();
_l.Label = keyboardConfig.LeftJoycon.ButtonL.ToString();
_zL.Label = keyboardConfig.LeftJoycon.ButtonZl.ToString();
_lSl.Label = keyboardConfig.LeftJoycon.ButtonSl.ToString();
_lSr.Label = keyboardConfig.LeftJoycon.ButtonSr.ToString();
_rStickUp.Label = keyboardConfig.RightJoycon.StickUp.ToString();
_rStickDown.Label = keyboardConfig.RightJoycon.StickDown.ToString();
_rStickLeft.Label = keyboardConfig.RightJoycon.StickLeft.ToString();
_rStickRight.Label = keyboardConfig.RightJoycon.StickRight.ToString();
_rStickButton.Label = keyboardConfig.RightJoycon.StickButton.ToString();
_a.Label = keyboardConfig.RightJoycon.ButtonA.ToString();
_b.Label = keyboardConfig.RightJoycon.ButtonB.ToString();
_x.Label = keyboardConfig.RightJoycon.ButtonX.ToString();
_y.Label = keyboardConfig.RightJoycon.ButtonY.ToString();
_plus.Label = keyboardConfig.RightJoycon.ButtonPlus.ToString();
_r.Label = keyboardConfig.RightJoycon.ButtonR.ToString();
_zR.Label = keyboardConfig.RightJoycon.ButtonZr.ToString();
_rSl.Label = keyboardConfig.RightJoycon.ButtonSl.ToString();
_rSr.Label = keyboardConfig.RightJoycon.ButtonSr.ToString();
_slotNumber.Value = keyboardConfig.Slot;
_altSlotNumber.Value = keyboardConfig.AltSlot;
_sensitivity.Value = keyboardConfig.Sensitivity;
_gyroDeadzone.Value = keyboardConfig.GyroDeadzone;
_enableMotion.Active = keyboardConfig.EnableMotion;
_mirrorInput.Active = keyboardConfig.MirrorInput;
_dsuServerHost.Buffer.Text = keyboardConfig.DsuServerHost;
_dsuServerPort.Buffer.Text = keyboardConfig.DsuServerPort.ToString();
break;
case ControllerConfig controllerConfig:
if (!_controllerType.SetActiveId(controllerConfig.ControllerType.ToString()))
@ -372,6 +401,14 @@ namespace Ryujinx.Ui
_controllerDeadzoneLeft.Value = controllerConfig.DeadzoneLeft;
_controllerDeadzoneRight.Value = controllerConfig.DeadzoneRight;
_controllerTriggerThreshold.Value = controllerConfig.TriggerThreshold;
_slotNumber.Value = controllerConfig.Slot;
_altSlotNumber.Value = controllerConfig.AltSlot;
_sensitivity.Value = controllerConfig.Sensitivity;
_gyroDeadzone.Value = controllerConfig.GyroDeadzone;
_enableMotion.Active = controllerConfig.EnableMotion;
_mirrorInput.Active = controllerConfig.MirrorInput;
_dsuServerHost.Buffer.Text = controllerConfig.DsuServerHost;
_dsuServerPort.Buffer.Text = controllerConfig.DsuServerPort.ToString();
break;
}
}
@ -448,7 +485,15 @@ namespace Ryujinx.Ui
ButtonZr = rButtonZr,
ButtonSl = rButtonSl,
ButtonSr = rButtonSr
}
},
EnableMotion = _enableMotion.Active,
MirrorInput = _mirrorInput.Active,
Slot = (int)_slotNumber.Value,
AltSlot = (int)_slotNumber.Value,
Sensitivity = (int)_sensitivity.Value,
GyroDeadzone = _gyroDeadzone.Value,
DsuServerHost = _dsuServerHost.Buffer.Text,
DsuServerPort = int.Parse(_dsuServerPort.Buffer.Text)
};
}
@ -521,7 +566,15 @@ namespace Ryujinx.Ui
ButtonZr = rButtonZr,
ButtonSl = rButtonSl,
ButtonSr = rButtonSr
}
},
EnableMotion = _enableMotion.Active,
MirrorInput = _mirrorInput.Active,
Slot = (int)_slotNumber.Value,
AltSlot = (int)_slotNumber.Value,
Sensitivity = (int)_sensitivity.Value,
GyroDeadzone = _gyroDeadzone.Value,
DsuServerHost = _dsuServerHost.Buffer.Text,
DsuServerPort = int.Parse(_dsuServerPort.Buffer.Text)
};
}
@ -779,7 +832,15 @@ namespace Ryujinx.Ui
ButtonZr = Key.O,
ButtonSl = Key.Unbound,
ButtonSr = Key.Unbound
}
},
EnableMotion = false,
MirrorInput = false,
Slot = 0,
AltSlot = 0,
Sensitivity = 100,
GyroDeadzone = 1,
DsuServerHost = "127.0.0.1",
DsuServerPort = 26760
};
}
else if (_inputDevice.ActiveId.StartsWith("controller"))
@ -824,7 +885,15 @@ namespace Ryujinx.Ui
ButtonSr = ControllerInputId.Unbound,
InvertStickX = false,
InvertStickY = false
}
},
EnableMotion = false,
MirrorInput = false,
Slot = 0,
AltSlot = 0,
Sensitivity = 100,
GyroDeadzone = 1,
DsuServerHost = "127.0.0.1",
DsuServerPort = 26760
};
}
}

View file

@ -1,24 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="_altSlotNumber">
<property name="upper">4</property>
<property name="step_increment">1</property>
<property name="page_increment">4</property>
</object>
<object class="GtkAdjustment" id="_controllerDeadzoneLeft">
<property name="upper">1</property>
<property name="value">0.050000000000000003</property>
<property name="value">0.05</property>
<property name="step_increment">0.01</property>
<property name="page_increment">0.10000000000000001</property>
<property name="page_increment">0.1</property>
</object>
<object class="GtkAdjustment" id="_controllerDeadzoneRight">
<property name="upper">1</property>
<property name="value">0.050000000000000003</property>
<property name="value">0.05</property>
<property name="step_increment">0.01</property>
<property name="page_increment">0.10000000000000001</property>
<property name="page_increment">0.1</property>
</object>
<object class="GtkAdjustment" id="_controllerTriggerThreshold">
<property name="upper">1</property>
<property name="value">0.5</property>
<property name="step_increment">0.01</property>
<property name="page_increment">0.10000000000000001</property>
<property name="page_increment">0.1</property>
</object>
<object class="GtkAdjustment" id="_gyroDeadzone">
<property name="upper">100</property>
<property name="value">0.01</property>
<property name="step_increment">0.01</property>
<property name="page_increment">0.1</property>
<property name="page_size">0.1</property>
</object>
<object class="GtkAdjustment" id="_sensitivity">
<property name="upper">1000</property>
<property name="value">100</property>
<property name="step_increment">1</property>
<property name="page_increment">4</property>
</object>
<object class="GtkAdjustment" id="_slotNumber">
<property name="upper">4</property>
<property name="step_increment">1</property>
<property name="page_increment">4</property>
</object>
<object class="GtkWindow" id="_controllerWin">
<property name="can_focus">False</property>
@ -27,9 +50,6 @@
<property name="window_position">center</property>
<property name="default_width">1100</property>
<property name="default_height">600</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -1617,12 +1637,301 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkBox" id="MotionBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="label" translatable="yes">Motion</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="_enableMotion">
<property name="label" translatable="yes">Enable Motion Controls</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_right">17</property>
<property name="label" translatable="yes">Controller Slot</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="_slot">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_left">10</property>
<property name="adjustment">_slotNumber</property>
<property name="climb_rate">1</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_right">5</property>
<property name="label" translatable="yes">Gyro Sensitivity %</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">_sensitivity</property>
<property name="climb_rate">1</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="_altBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="_mirrorInput">
<property name="label" translatable="yes">Mirror Input</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Right JoyCon Slot</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="_slotRight">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="text" translatable="yes">0</property>
<property name="climb_rate">1</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">30</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Server Host</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="_dsuServerHost">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">30</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Server Port</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="_dsuServerPort">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Gyro Deadzone</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkScale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">_gyroDeadzone</property>
<property name="round_digits">2</property>
<property name="digits">2</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">8</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
@ -1721,5 +2030,8 @@
</child>
</object>
</child>
<child type="titlebar">
<placeholder/>
</child>
</object>
</interface>

View file

@ -13,6 +13,7 @@ using Ryujinx.HLE.HOS.Services.Hid;
using System;
using System.Collections.Generic;
using System.Threading;
using Ryujinx.Motion;
namespace Ryujinx.Ui
{
@ -48,6 +49,8 @@ namespace Ryujinx.Ui
private HotkeyButtons _prevHotkeyButtons;
private Client _dsuClient;
private GraphicsDebugLevel _glLogLevel;
public GlRenderer(Switch device, GraphicsDebugLevel glLogLevel)
@ -79,6 +82,8 @@ namespace Ryujinx.Ui
this.Shown += Renderer_Shown;
_dsuClient = new Client();
_glLogLevel = glLogLevel;
}
@ -90,6 +95,7 @@ namespace Ryujinx.Ui
private void GLRenderer_ShuttingDown(object sender, EventArgs args)
{
_device.DisposeGpu();
_dsuClient?.Dispose();
}
private void Parent_FocusOutEvent(object o, Gtk.FocusOutEventArgs args)
@ -104,6 +110,7 @@ namespace Ryujinx.Ui
private void GLRenderer_Destroyed(object sender, EventArgs e)
{
_dsuClient?.Dispose();
Dispose();
}
@ -287,6 +294,7 @@ namespace Ryujinx.Ui
public void Exit()
{
_dsuClient?.Dispose();
if (IsStopped)
{
return;
@ -406,7 +414,10 @@ namespace Ryujinx.Ui
}
List<GamepadInput> gamepadInputs = new List<GamepadInput>(NpadDevices.MaxControllers);
List<SixAxisInput> motionInputs = new List<SixAxisInput>(NpadDevices.MaxControllers);
MotionDevice motionDevice = new MotionDevice(_dsuClient);
foreach (InputConfig inputConfig in ConfigurationState.Instance.Hid.InputConfig.Value)
{
ControllerKeys currentButton = 0;
@ -419,6 +430,11 @@ namespace Ryujinx.Ui
int rightJoystickDx = 0;
int rightJoystickDy = 0;
if (inputConfig.EnableMotion)
{
motionDevice.RegisterController(inputConfig.PlayerIndex);
}
if (inputConfig is KeyboardConfig keyboardConfig)
{
if (IsFocused)
@ -488,6 +504,19 @@ namespace Ryujinx.Ui
currentButton |= _device.Hid.UpdateStickButtons(leftJoystick, rightJoystick);
motionDevice.Poll(inputConfig.PlayerIndex, inputConfig.Slot);
SixAxisInput sixAxisInput = new SixAxisInput()
{
PlayerId = (HLE.HOS.Services.Hid.PlayerIndex)inputConfig.PlayerIndex,
Accelerometer = motionDevice.Accelerometer,
Gyroscope = motionDevice.Gyroscope,
Rotation = motionDevice.Rotation,
Orientation = motionDevice.Orientation
};
motionInputs.Add(sixAxisInput);
gamepadInputs.Add(new GamepadInput
{
PlayerId = (HLE.HOS.Services.Hid.PlayerIndex)inputConfig.PlayerIndex,
@ -495,9 +524,29 @@ namespace Ryujinx.Ui
LStick = leftJoystick,
RStick = rightJoystick
});
}
if (inputConfig.ControllerType == Common.Configuration.Hid.ControllerType.JoyconPair)
{
if (!inputConfig.MirrorInput)
{
motionDevice.Poll(inputConfig.PlayerIndex, inputConfig.AltSlot);
sixAxisInput = new SixAxisInput()
{
PlayerId = (HLE.HOS.Services.Hid.PlayerIndex)inputConfig.PlayerIndex,
Accelerometer = motionDevice.Accelerometer,
Gyroscope = motionDevice.Gyroscope,
Rotation = motionDevice.Rotation,
Orientation = motionDevice.Orientation
};
}
motionInputs.Add(sixAxisInput);
}
}
_device.Hid.Npads.Update(gamepadInputs);
_device.Hid.Npads.UpdateSixAxis(motionInputs);
if(IsFocused)
{

View file

@ -82,6 +82,7 @@ namespace Ryujinx.Ui
[GUI] ToggleButton _configureController7;
[GUI] ToggleButton _configureController8;
[GUI] ToggleButton _configureControllerH;
#pragma warning restore CS0649, IDE0044
public SettingsWindow(VirtualFileSystem virtualFileSystem, HLE.FileSystem.Content.ContentManager contentManager) : this(new Builder("Ryujinx.Ui.SettingsWindow.glade"), virtualFileSystem, contentManager) { }

View file

@ -7,11 +7,6 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkEntryCompletion" id="_systemTimeZoneCompletion">
<property name="inline-completion">True</property>
<property name="inline-selection">True</property>
<property name="minimum-key-length">0</property>
</object>
<object class="GtkAdjustment" id="_systemTimeDaySpinAdjustment">
<property name="lower">1</property>
<property name="upper">31</property>
@ -40,6 +35,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkEntryCompletion" id="_systemTimeZoneCompletion">
<property name="minimum_key_length">0</property>
<property name="inline_completion">True</property>
<property name="inline_selection">True</property>
</object>
<object class="GtkWindow" id="_settingsWin">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Ryujinx - Settings</property>
@ -1062,6 +1062,17 @@
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
@ -1737,8 +1748,8 @@
<property name="tooltip_text" translatable="yes">Floating point resolution scale, such as 1.5. Non-integral scales are more likely to cause issues or crash.</property>
<property name="valign">center</property>
<property name="caps_lock_warning">False</property>
<property name="placeholder-text">1.0</property>
<property name="input-purpose">GTK_INPUT_PURPOSE_NUMBER</property>
<property name="placeholder_text">1.0</property>
<property name="input_purpose">number</property>
</object>
<packing>
<property name="expand">True</property>