mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-30 15:06:26 +02:00
Move solution and projects to src
This commit is contained in:
parent
cd124bda58
commit
cee7121058
3466 changed files with 55 additions and 55 deletions
29
src/Ryujinx.Input/KeyboardStateSnapshot.cs
Normal file
29
src/Ryujinx.Input/KeyboardStateSnapshot.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ryujinx.Input
|
||||
{
|
||||
/// <summary>
|
||||
/// A snapshot of a <see cref="IKeyboard"/>.
|
||||
/// </summary>
|
||||
public class KeyboardStateSnapshot
|
||||
{
|
||||
private bool[] _keysState;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="KeyboardStateSnapshot"/>.
|
||||
/// </summary>
|
||||
/// <param name="keysState">The keys state</param>
|
||||
public KeyboardStateSnapshot(bool[] keysState)
|
||||
{
|
||||
_keysState = keysState;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if a given key is pressed.
|
||||
/// </summary>
|
||||
/// <param name="key">The key</param>
|
||||
/// <returns>True if the given key is pressed</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool IsPressed(Key key) => _keysState[(int)key];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue