1

I am developing a web site and when I open it using Galaxy S6 with android 7.0 and focus on an input field I can see next and prev buttons at the top of the keyboard.

Next and prev buttons

Next button is supposed to act like Tab. Every time next is pressed it jumps to the next tabbable element but it doesn't skip the invisible once.

Is it possible from the browser to hook to next and prev press event in any way?

  • Hi Anna, I don't seem to get your intent, it needs to be narrowed, could you please post some code? Or just tell us what platform/language are using? is it Java, C# or else? – khalid3e Aug 29 '18 at 14:25

1 Answers1

0

I found a very interesting solution here. Basicly, by default there is a little problem with dispatching key events in a regular Android views. Most keycodes looks like they are locked by default. Android documentation says:

When handling keyboard events with the KeyEvent class and related APIs, you should expect that such keyboard events come only from a hardware keyboard. You should never rely on receiving key events for any key on a soft input method (an on-screen keyboard).

I have tested available methods with a EditText, and there was possible to get only a few keys like keycode back, many keys isn't available. But where I created a custom class, which extends from EditText, and using overridden dispatchKeyEvent(KeyEvent event) and onCreateInputConnection(EditorInfo outAttrs) methods, it was possible to read most existing keys.
Followig this example, you can create your own WebView class, override dispatchKeyEvent, onCreateInputConnection and check, which event will be send by using your keys. I hope that's help you.

grabarz121
  • 616
  • 5
  • 13