Capture keys typed on android virtual keyboard using javascript

Unfortunately it seems you cannot do much here.
Keypress event is deprecated, thus not fired.
229 on keyup and keydown indicates the keyboard buffer is busy. The reason – when you press a key – the input is still not guaranteed to be what the user pressed, because of auto suggest and other events that may follow immediately and invalidate the event.
Although in my opinion it would have been better to send the key first, then fire another event perhaps on auto suggest so you can act upon it separately…

The only thing that I currently know of is to attach to both – keydown and keyup, store the value on keydown, get the value on keyup and find the delta, which is what user pressed. Unfortunately this will not work for non-input controls (e.g. – the body or something like that).
Maybe not what you want to hear as answer but still.

Leave a Comment