devkitPro / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
11 stars 12 forks source link

ogc: add USB keyboard support #68

Closed mrpapersonic closed 3 months ago

mrpapersonic commented 3 months ago

This adds a new file, SDL_ogckeyboard.c that handles keyboard events using libwiikeyboard. It also converts the 16-bit Unicode symbol from libwiikeyboard into a UTF-8 array if text input is enabled.

Right now some key inputs (e.g. Home, Arrow Keys, etc.) give text inputs even when we don't want them Turns out libwiikeyboard stores these in the private area (0xE000-0xFF8F), so they're easy enough to filter out.

mardy commented 3 months ago

Thanks, LGTM. I would have squashed the changes from the last commit with the respective commits which introduced the changes, in order not to create "noise" in the git history, but the code looks good to me. I'll leave the final word to @WinterMute :-)

WinterMute commented 3 months ago

Good job, thanks for the PR. I've merged this & rebuilt our sdl2 packages so it should be usable with stock now.