nesbox / TIC-80

TIC-80 is a fantasy computer for making, playing and sharing tiny games.
https://tic80.com
MIT License
5k stars 483 forks source link

`key` and `keyp` don't work with foreign keyboards #2331

Open thacuber2a03 opened 1 year ago

thacuber2a03 commented 1 year ago

(Linux, Pop!_OS 22.04, Cinnamon DE) as of now, key and keyp base on the assumption that the keyboard the programmer's using is English, and yeah, that's a safe assumption, but that isn't always the case. for example, I use a Spanish (Dominican Republic) keyboard, and so, there are keys that neither function catches as pressed, like [, ], ;, ~ and so on.

Skeptim commented 1 year ago

Which version are you using? Did you check with this build https://nightly.link/nesbox/TIC-80/workflows/build/main that should be released soon?

thacuber2a03 commented 1 year ago

yes

joshgoebel commented 1 year ago

This might not be easy to fix as I think SDL character constants are based on hardware keycodes/scancodes if I'm not mistaken.

thacuber2a03 commented 1 year ago

and how do TIC's work?

joshgoebel commented 1 year ago

TIC uses SDL on linux for it's inputs...

thacuber2a03 commented 1 year ago

dumb question here, but can't it check the character that was pressed instead? like, instead of checking for x physical key to be pressed, check for x character

joshgoebel commented 1 year ago

Maybe. I don't really know. I found a long thing on google but it was from 2014 - so perhaps a lot has changed since then.