2

I have a WebView with keyboard-controlled javascript in it, but then meet a problem that: Webview won't pass the arrow key to Javascript. Codes are like:

public void onCreate(Bundle savedInstanceState) {
    mWebView = new MyWebView(this);
    setContentView(mWebView);
}

When I launch this Activity and press arrow key, the WebView moves and JavaScript in loaded pages does not trigger. Other keys like Enter or alphabets work well.

Is there a way to bypass arrow keys into web pages? Thanks.

TofferJ
  • 4,678
  • 1
  • 37
  • 49
Romulus Urakagi Ts'ai
  • 3,699
  • 10
  • 42
  • 68

1 Answers1

0

You have to override onKeyDown method for view. You can find how to do that here.

Community
  • 1
  • 1
alxndr
  • 2,349
  • 3
  • 17
  • 14