Started making Input framebased and added KeyCodes

This commit is contained in:
Simon Lübeß
2020-11-14 15:09:59 +01:00
parent 356011119b
commit 696961e46c
9 changed files with 221 additions and 23 deletions
+27 -3
View File
@@ -6,16 +6,40 @@ namespace GlitchyEngine
{
public static class Input
{
public static extern bool IsKeyPressed(int32 keycode);
public static extern bool IsKeyReleased(int32 keycode);
public static extern bool IsKeyToggled(int32 keycode);
public static extern bool IsKeyPressed(Key keycode);
public static extern bool IsKeyReleased(Key keycode);
public static extern bool IsKeyToggled(Key keycode);
public static extern bool WasKeyPressed(Key keycode);
public static extern bool WasKeyReleased(Key keycode);
public static extern bool WasKeyToggled(Key keycode);
/*
* Determines whether or not the key is being pressed down.
* @remarks IsKeyPressing(kc) == IsKeyPressed(kc) && !IsKeyReleased(kc)
*/
public static extern bool IsKeyPressing(Key keycode);
/*
* Determines whether or not the key is being released down.
* @remarks IsKeyReleasing(kc) == !IsKeyPressed(kc) && IsKeyReleased(kc)
*/
public static extern bool IsKeyReleasing(Key keycode);
public static extern bool IsMouseButtonPressed(MouseButton button);
public static extern bool IsMouseButtonReleased(MouseButton button);
public static extern bool WasMouseButtonPressed(MouseButton button);
public static extern bool WasMouseButtonReleased(MouseButton button);
public static extern int32 GetMouseX();
public static extern int32 GetMouseY();
public static extern int32 GetLastMouseX();
public static extern int32 GetLastMouseY();
public static extern Point GetMousePosition();
public static extern Point GetLastMousePosition();
public static extern void NewFrame();
}
}