I created a simple AngularJs directive which add a bind to "keypress" event:
app.directive('filterInput', function() {
return {
restrict: 'A',
scope: {},
link: function(scope, elem, attr) {
elem.bind('keypress', function(e) {
alert(e.code || e.which);
})
elem.on('keypress', function(e) {
alert(e.code || e.which);
})
}
}
})
Just for test there are both "bind" and "on" hooks. This works fine for iOS devices. However In Android, if you press a comma, enter or whatever is not a number the event won't fire.
working JSFiddle, open it on Android device
Update:
I added:
elem.on('input', function(e) {
alert(e.code || e.which);
})
and now the event is firing for all keys (bytheway the event code is undefined) except for enter (keycode 13). Unfortunately I need to intercept exactly that key.