diff options
| author | ubq323 <ubq323@ubq323.website> | 2024-04-13 16:30:46 +0100 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2024-04-19 11:10:28 +0200 |
| commit | f2e40ecffec519e1094ed829f8735309ae67997f (patch) | |
| tree | 8168a12577b1a7f38f0a692aa049b5c3debb3e87 /sdl2/keyboard.ha | |
| parent | Add SDL_GetRendererOutputSize. (diff) | |
| download | hare-chip8-f2e40ecffec519e1094ed829f8735309ae67997f.tar.gz | |
add a few functions
these are some sdl functions i needed for a project.
there is not much structure beyond that.
Diffstat (limited to 'sdl2/keyboard.ha')
| -rw-r--r-- | sdl2/keyboard.ha | 10 |
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; +}; + |
