js: how to get LOCALIZED character on keypress?

I need to get localized character on keypress event. For example: on czech keybord I need to get ř not 5 character (key code 53) (see Czech keyboard layout). Is there any other way to get character and to not use text input and reading value? By other words is there any way how to get character from event object respecting current user keyboard layout?


(added sample code)





    


(example online)

When you try this code, and you press ř-key you will see in Firebug console "Code: 53; Key: 5". And I need to get "ř" not "5".

I think that this "problem" appears on all non-english keybords.

8
задан Honza Kuchař 18 December 2014 в 12:25
поделиться