Hello,
What is the way to obtain the char keyCode value on input, keydown or keypress
events for Firefox 35.0 for Android?
The following code don't work for me:
input.on("input keydown keypress",function(e){
var key = e.which || e.keyCode;
console.log("Keypress is detected and keyCode is: " + key);
//Ensure that it is a number and stop the keypress
if ((e.shiftKey || (key < 48 || key > 57)) && (key < 96 || key > 105) &&
(key !== 8) && (key !== 46) && (key !== 9) && (key < 37 || key > 40)) {
e.preventDefault();
console.log("inside the prevent default method");
}
});
the e.which returns 0 and the e.keyCode returns undefined
Can you please help?
Thanks!
Svetoslav
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g