- Home /
How to bind unicode input to logic keys?
Is it possible to let the user bind
a logic input key jump to e.g. 'ø'?
the horizontal input axis to 'ø' and 'å'?
at runtime from script w/o the unity launcher window?
I currently have 2 workarounds that I don't like
Be agnostic about the unicode input and just map unity keycodes - kind of treating all keyboards as american in code without knowing what key the user actually is pressing
Read Input.inputstring and use it map to a logic key. For single key presses this works fine, but it fails for multiple key presses e.g. when pressing both 'æ' and 'ø' Input.inputString can only report 1 of them.
Currently, we use the later solution with some adaptive popularity counting.
Thanks in advance!
--
Answer by keld-oelykke · Jun 06, 2011 at 09:56 PM
... For single key presses this works fine, but it fails for multiple key presses e.g. when pressing both 'æ' and 'ø' Input.inputString can only report 1 of them. ...
Found a solution for this. Instead of using Input-members in Update, I now use Event-members in OnGUI. Keys that map to a character value produces 2 key down event: 1st with keycode and 2nd with accompanying unicode character value. The only tricky thing is that we need to guess whether a 2nd will event will come or not.