This commit is contained in:
Max Westerlund
2025-09-02 13:17:15 +02:00
parent b6f9966eb9
commit 71c5f3a3aa
15 changed files with 618 additions and 37 deletions

24
Input.cs Normal file
View File

@@ -0,0 +1,24 @@
using OpenTK.Windowing.GraphicsLibraryFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;
}
}
}