airstruck / luigi

Lovely User Interfaces for Game Inventors
MIT License
113 stars 23 forks source link

Expose scancodes during KeyPress and KeyRelease events. #53

Closed Lukc closed 7 years ago

Lukc commented 7 years ago

Scancodes are helpful in that they are independent from the user’s keyboard layout (and are not “unknown” when unicode characters are being entered…).

Löve’s API makes it easy to obtain them: https://love2d.org/wiki/love.keypressed Haven’t checked SDL’s API, sorry. :(

airstruck commented 7 years ago

Sounds reasonable. Pull requests welcome, have a look at Input:handleKey* in input.lua and Backend.show in backend/*.lua. SDL scancodes are mapped to Love equivalents in backend/ffisdl/keyboard.lua