I have a simple WebView application which I want to control with the keyboard. Is it possible to catch arrow keys in Javascript?
I have tried the following code without any luck:
function handleArrowKeys(evt) {
console.info('key');
}
document.onkeyup = handleArrowKeys;
document.onkedown = handleArrowKeys;
document.onkepress = handleArrowKeys;
Javascript is enabled in the webview
WebSettings webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);