GetChar doesn't return German Umlaute

Monkey Forums/Monkey Programming/GetChar doesn't return German Umlaute

Ratchet(Posted 2016) [#1]
I need to type in German Umlaute and other special chars like ö ü ä ß é ...
But GetChar doesn't handle them.

For displaying text I'm using glText from Diddy, so displaying special chars is not the Problem (the default Monkey font doesn't include special chars).


Nobuyuki(Posted 2016) [#2]
This behavior is probably target-specific. On GLFW I had problems in the past with international layout keyboards not detecting certain keys. If a scan of all charcodes isn't producing anything when the key is pressed then you probably aren't going to have much luck


Ratchet(Posted 2016) [#3]
My target is HTML5 and I have a dorty workaround for it. I edited the template html5game.js and removed the last line in canvas.onkeydown:



Very, very dirty, but the only way to receive special chars. I don't understand the logic behind this line. Ok, I ca nunderstand < 48 (0) , but why > 111 (o) and < 122 (z)? Why o - z (111 - 122)? Isn't it ASCII-Code?


Nobuyuki(Posted 2016) [#4]
The js keycodes list is different from ASCII. It looks like on HTML5 target it is processing this via a KeyEvent, so probably that code is for making sure the function keys aren't being read.

If you believe this is a bug, you should post a bug report about it. However it would probably be best first to try to determine why that line exists -- The numbers don't cleanly exclude all of the function keys, so I'd be curious as well! Maybe try asking Mark.

edit: this page isn't working for me right now, but when searching for information I found that at one point (maybe not true now?) Firefox reported an incorrect keycode for umlaut characters: https://bugzilla.mozilla.org/show_bug.cgi?id=909280