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:
parent
a10b2c5ff2
commit
77aab9aca3
16 changed files with 200 additions and 32 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue