im displaying web page content in webview and i want to disable the all 4 arrow key of android keyboard. any idea?
edit:
public boolean onKeyDown(int keyCode, KeyEvent event) {
int a;
Log.d("yourTag",""+event.getAction());
System.out.println(a=event.getAction());
System.out.println(keyCode);
if(event.getAction()==20){
return true;
}
else if(event.getAction()==21){
return true;
}
else if(event.getAction()==22){
return true;
}
else{
return true;
}
}
scrolling still there but back key and menu key is disabled why? i noticed it returns nothing if content is scrolling. once scrolling ends it(log.d message) returns 0.
You can catch them in an onkeydown?
You’d only have to find the code for the arrow-keys, that shouldn’t be to hard. You could even just Log.d your
event.getAction(), and press them, to find out what they’re called…I don’t really know what you are doing with your debugcode, but check out this link: http://developer.android.com/reference/android/view/KeyEvent.html for the key events. The events are integers. Why don’t you add this for debugging:
and see what’s returned? My guess would be one of the DPAD keys, for instance left ( 21 ) are your target