I have been having trouble with Hangul (KO) character input on an html5 webpage that uses Ajax. console.log will not log the keystrokes for Hangul, but it will log English keystrokes. The code that is supposed to show what I type is as follows:
document.getElementById('userText').addEventListener('keydown', function(event) {
console.log('410-Key pressed: ', event.key);
.... lot's of other code
}
How can I get the key events for Hangul characters instead of just the word 'process'?
This problem occurs on both Firefox and chrome browsers on the desktop.
The <html lang="ko"> tag is present.
The typing is taking place in an element of type textarea
<textarea id="userText" lang="KO"></textarea>.
This is part of a larger problem where, on android mobile devices, the initial Hangul character typed is shown as the individual key-presses while subsequent Hangul characters are properly assembled and shown as syllable characters.
I was expecting to see the character typed, whether English or Korean. In the case of Korean I was expecting to see the individual vowels and consonant characters and then the syllable character.