From bfcc6a8ad63a0eb0f06968145a310c484a96e8ca Mon Sep 17 00:00:00 2001 From: emmauss Date: Mon, 14 Jun 2021 06:42:55 +0000 Subject: Add TouchScreen Manager (#2333) --- Ryujinx.Input/MouseStateSnapshot.cs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Ryujinx.Input/MouseStateSnapshot.cs (limited to 'Ryujinx.Input/MouseStateSnapshot.cs') diff --git a/Ryujinx.Input/MouseStateSnapshot.cs b/Ryujinx.Input/MouseStateSnapshot.cs new file mode 100644 index 00000000..4fbfeebd --- /dev/null +++ b/Ryujinx.Input/MouseStateSnapshot.cs @@ -0,0 +1,34 @@ +using System.Numerics; +using System.Runtime.CompilerServices; + +namespace Ryujinx.Input +{ + /// + /// A snapshot of a . + /// + public class MouseStateSnapshot + { + private bool[] _buttonState; + + public Vector2 Position { get; } + + /// + /// Create a new . + /// + /// The keys state + public MouseStateSnapshot(bool[] buttonState, Vector2 position) + { + _buttonState = buttonState; + + Position = position; + } + + /// + /// Check if a given button is pressed. + /// + /// The button + /// True if the given button is pressed + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsPressed(MouseButton button) => _buttonState[(int)button]; + } +} \ No newline at end of file -- cgit v1.2.3