aboutsummaryrefslogtreecommitdiff
path: root/sdl2/keyboard.ha
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sdl2/keyboard.ha10
1 files changed, 10 insertions, 0 deletions
diff --git a/sdl2/keyboard.ha b/sdl2/keyboard.ha
index d42fa8a..cc137d2 100644
--- a/sdl2/keyboard.ha
+++ b/sdl2/keyboard.ha
@@ -643,3 +643,13 @@ export fn SDL_GetKeyFromName(name: str) (SDL_Keycode | error) = {
};
return sym;
};
+
+@symbol("SDL_GetKeyboardState") fn _SDL_GetKeyboardState(numkeys: *int) *[*]bool;
+
+export fn SDL_GetKeyboardState() []bool = {
+ let numkeys: int = 0;
+ let arr = _SDL_GetKeyboardState(&numkeys);
+ let arr = arr[..numkeys];
+ return arr;
+};
+