changing the code to make it work on Chrome mobile

Chrome mobile doesn't trigger the `keypress` event neither provides the key code on keydown, keyup or compositionupdate events. Unfortunately there's no way to get the same result  as on other browsers.