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

@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
{
public MouseDevice(Switch device, bool active) : base(device, active) { }
public void Update(int mouseX, int mouseY, uint buttons = 0, int scrollX = 0, int scrollY = 0)
public void Update(int mouseX, int mouseY, uint buttons = 0, int scrollX = 0, int scrollY = 0, bool connected = false)
{
ref RingLifo<MouseState> lifo = ref _device.Hid.SharedMemory.Mouse;
@ -27,6 +27,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
newState.DeltaY = mouseY - previousEntry.DeltaY;
newState.WheelDeltaX = scrollX;
newState.WheelDeltaY = scrollY;
newState.Attributes = connected ? MouseAttribute.IsConnected : MouseAttribute.None;
}
lifo.Write(ref newState);