I have run the normal textbox in android device an i have face some issues which is mentioned below.
1.Keypress event does not triggered in android device 2.keycode value always return as 229 only
How to resolve this issue?
key 13 keycode is for ENTER key.
A key code is a series of alphanumeric characters used by locksmiths to create a key.
e.keyCode - used to get the number that represents the key on the keyboard. e.charCode - a number that represents the unicode character of the key on keyboard.
Normal keypress event does not give keyCode in android device. There has already been a big discussion on this.
If you want to capture the press of space bar
or special chars
, you can use keyup
event.
$('#input').on('keyup', e => {
var keyCode = e.keyCode || e.which;
if (keyCode == 0 || keyCode == 229) {
keyCode = e.target.value.charAt(e.target.selectionStart - 1).charCodeAt();
}
})
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