From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001
From: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:22:00 +0200
Subject: Move solution and projects to src
---
src/Ryujinx.Input/KeyboardStateSnapshot.cs | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 src/Ryujinx.Input/KeyboardStateSnapshot.cs
(limited to 'src/Ryujinx.Input/KeyboardStateSnapshot.cs')
diff --git a/src/Ryujinx.Input/KeyboardStateSnapshot.cs b/src/Ryujinx.Input/KeyboardStateSnapshot.cs
new file mode 100644
index 00000000..da77a461
--- /dev/null
+++ b/src/Ryujinx.Input/KeyboardStateSnapshot.cs
@@ -0,0 +1,29 @@
+using System.Runtime.CompilerServices;
+
+namespace Ryujinx.Input
+{
+ ///
+ /// A snapshot of a .
+ ///
+ public class KeyboardStateSnapshot
+ {
+ private bool[] _keysState;
+
+ ///
+ /// Create a new .
+ ///
+ /// The keys state
+ public KeyboardStateSnapshot(bool[] keysState)
+ {
+ _keysState = keysState;
+ }
+
+ ///
+ /// Check if a given key is pressed.
+ ///
+ /// The key
+ /// True if the given key is pressed
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public bool IsPressed(Key key) => _keysState[(int)key];
+ }
+}
--
cgit v1.2.3