Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript read keypresses on tablet?

Tags:

I have this interesting problem - I would like to read keypresses using javascript, but not directed into a text field.

This is straightforward on computers and I have that working (As long as the window has focus, the javascript can detect keypresses). However, on tablets running Android and iOS, the operating system ignores the keypresses. The javascript code only receives the keypress data if I am focused in a text field.

Is there some way around this? I would like to read the keypresses on tablets without having to be focused in a text field.