简体   繁体   中英

How to handle events with a webapp?

I develop a WebApp for a special tablet. On this tablet an embedded linux is the operating system. The tablet provides four keys which can be additionally used for inputs. The input of these keys can be tracked by reading /dev/input/event0 . Now I want to use JavaScript to handle these events and trigger events in the WebApp. How can I handle such events in JavaScript? Is this possible to handle such kind of events?

The technology you need is called WebSocket . As soon as your browser/WebApp connects to the server, a bidirectional channel is established, so that server can asynchronously send data to the browser. This way you can send your key events and your WebApp can react to them in "real-time".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM