KeyboardEvent : How to correctly identify the key pressed

I have a requirement to identify the key pressed on the android/iOS keyboard. This was achieved successfully using (keyup) event on the input field.

But, the keyCode (or even the key) property on the KeyboardEvent does not seem to be reliable when the actual mobile device uses a non native keyboard like SwiftKey or Huawei swype keyboard.

I checked the MSDN documentation on KeyboardEvent but was not able to figure out what I am doing wrong. Has anyone encountered similar issues before?

Any help would be appreciated.

i have the same problem, the output of keycode is always 0, on all devices and i am stuck .