$(document).ready(function () {
$("#id").keydown(function () {
});
})
This code perfectly works for everything(number,alphabet,symbol etc) except Japanese text. On key press it doesn't pass through this event. Does anybody know any solution?
There's hardly anything you can do. "Japanese text" means an IME, which is a piece of software intercepting the keyboard input and helping you turn it into Japanese text. How this software interacts or doesn't interact with the browser and the browser's Javascript engine depends on the OS, IME, browser and the browser's Javascript engine. On some platforms the keypress is signaled through, in others it isn't. You can try binding to other events like keyup
or keypress
, some may be signaled even when using an IME.
The best you can do is to make sure you're not depending on keypress events and have fallback options if you can't intercept them; e.g. bind to change
events on the text field as well and handle entire text changes, which will be triggered at the end of the IME input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With