Code: Select all
// complete list of symbols I'm interested in *+,<-.>/?!#$%6&():;[email protected]"`012345789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
love.textinput/textedited can be used to get symbols, but there is no release event for those. And there is no correlation between key events and text input, even if I choose to ignore all the special cases (weird composing, dead keys etc.). My only concern is making it work on standard western PC keyboards anyway, where each of the symbols I'm interested in can be created by pressing modifier(s) + key once.
So the only way I see to make this work is to make my own keymaps for each supported layout that can tell me which combination of keys creates one of the symbols from my list, and probably provide a keyboard layout selection UI for the user. I can think of ways to use love.keyboard.getKeyFromScancode to implement automatic layout detection, but I don't see a way around having my own keymaps.
Any input on how to do this? Or anyone have an idea what is the best way to obtain those keymaps for as many layouts as possible with as little work as possible? Some tool or database maybe, because I can't find anything that's usable without doing a lot of work on my own. All of this is madness and I don't want to do it.
Edit: context is making keydown/keyup events work in an emulator for a system with radically different scan codes and a unique layout, in a way that feels intuitive to the user. The system is based on polling a key matrix, so accurate keydown/keyup events are required.