0

Is there any way to detect while a key is pressed using event handler such as onkeyup, onkeydown in javascript in android based browser? I have called the following function using both onkeyup and onkeydown,both of which shows Unidentified result.

function fun(e)
{
  alert(e.key);
}

Calling the above javascript function using event handler:

<input type="text" onkeyup="fun(event)" onkeydown="fun(event)">

function fun(e) {
  console.log(e.key);
}
<input type="text" onkeyup="fun(event)" onkeydown="fun(event)">
Konrad
  • 21,590
  • 4
  • 28
  • 64
Parveez Ahmed
  • 1,325
  • 4
  • 17
  • 28
  • Useful links: https://stackoverflow.com/questions/30743490/capture-keys-typed-on-android-virtual-keyboard-using-javascript https://stackoverflow.com/questions/36753548/keycode-on-android-is-always-229 https://bugs.chromium.org/p/chromium/issues/detail?id=118639 – Konrad Nov 15 '22 at 10:14

0 Answers0