Files
voxel/Input.cs
2025-09-02 13:36:14 +02:00

20 lines
464 B
C#

using OpenTK.Windowing.GraphicsLibraryFramework;
namespace Voxel
{
public static class Input
{
private static Dictionary<Keys, bool> _keystates = new Dictionary<Keys, bool>();
public static bool GetKey(Keys key)
{
return _keystates.TryGetValue(key, out bool pressed) && pressed;
}
public static void SetKey(Keys key, bool pressed)
{
_keystates[key] = pressed;
}
}
}