I have changed my keyboard to a non-English language (Korean) and am looking to log characters inside my onKeyDown.
I came across this stack overflow post about using keypress instead but wasn’t able to get that to work either. Here is my jsfiddle.
I have a div with a keypress event. If you place your cursor/place focus on the blue div and start typing, you’d notice that irrespective of the language, it still logs English characters on the console.
$("#divtarget").keypress(function(event) {
var charCode = event.which; // charCode will contain the code of the character inputted
var theChar = String.fromCharCode(charCode); // theChar will contain the actual character
console.log(charCode, theChar);
});
How can I get Korean characters to show?