2

I'm facing the following problem : After my android tablet update to Android 4.4, the event in KeyDown

$("#txtStudentAnswer").keydown(function (event) {});

event.charCode always returns 0 event.keyCode always returns 229. Any help ? Or alternative solutions ?
This question is different than the on in Javascript .keyCode vs. .which? , it's a tablet and android issue more than keyCode and which issue.

Community
  • 1
  • 1
  • beside that `charCode` is deprecated: For a keydown event `charCode` should always be `0` because `[...]The KeyboardEvent.charCode read-only property returns the Unicode value of a character key pressed during a keypress event.[...]` ( [KeyboardEvent.charCode](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode) ). For jQuery you should use `event.which` because ` [...]browsers use differing properties to store this information, jQuery normalizes the .which property so you can reliably use it to retrieve[...]` ( [jQuery.keydown](https://api.jquery.com/keydown/) ) – t.niese Feb 11 '16 at 09:10
  • Possible duplicate of [Javascript .keyCode vs. .which?](http://stackoverflow.com/questions/4471582/javascript-keycode-vs-which) – t.niese Feb 11 '16 at 09:16
  • I have tried event.which and always it's returning 0. My code resemble to the following : if (event.charCode || event.keyCode) { unicode = event.charCode ? event.charCode : event.keyCode; }. Noting that the code is working normally on Chrome on Pc, and on firefox on tablet. – user3012488 Feb 11 '16 at 09:18

0 Answers0