fixed movement

This commit is contained in:
maxwes08
2025-10-07 10:37:46 +02:00
parent bd2c87ddd1
commit 7835ade2c1
6 changed files with 91 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
using OpenTK.Windowing.GraphicsLibraryFramework;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.GraphicsLibraryFramework;
namespace Voxel
{
@@ -7,6 +8,8 @@ namespace Voxel
private static Dictionary<Keys, bool> _keystates = new Dictionary<Keys, bool>();
private static Dictionary<MouseButton, bool> _mouseButtonStates = new Dictionary<MouseButton, bool>();
public static Action<MouseWheelEventArgs> OnMouseWheel;
public static bool GetMouseButton(MouseButton button)
{
return _mouseButtonStates.TryGetValue(button, out bool pressed) && pressed;
@@ -26,5 +29,10 @@ namespace Voxel
{
_keystates[key] = pressed;
}
public static void MouseWheel(MouseWheelEventArgs e)
{
OnMouseWheel.Invoke(e);
}
}
}