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

@ -14,18 +14,27 @@ namespace Ryujinx.Input.GTK3
public bool[] PressedButtons { get; }
public Vector2 CurrentPosition { get; private set; }
public Vector2 Scroll{ get; private set; }
public GTK3MouseDriver(Widget parent)
{
_widget = parent;
_widget.MotionNotifyEvent += Parent_MotionNotifyEvent;
_widget.ButtonPressEvent += Parent_ButtonPressEvent;
_widget.MotionNotifyEvent += Parent_MotionNotifyEvent;
_widget.ButtonPressEvent += Parent_ButtonPressEvent;
_widget.ButtonReleaseEvent += Parent_ButtonReleaseEvent;
_widget.ScrollEvent += Parent_ScrollEvent;
PressedButtons = new bool[(int)MouseButton.Count];
}
[GLib.ConnectBefore]
private void Parent_ScrollEvent(object o, ScrollEventArgs args)
{
Scroll = new Vector2((float)args.Event.X, (float)args.Event.Y);
}
[GLib.ConnectBefore]
private void Parent_ButtonReleaseEvent(object o, ButtonReleaseEventArgs args)
{