diff options
author | Devaev Maxim <[email protected]> | 2018-07-05 15:13:27 +0000 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-05 15:13:27 +0000 |
commit | 033ad8922c6407bd9e7ca77817afdb4ed40ffc82 (patch) | |
tree | 0ac0f0136c44232c37a876066e66013d479d184a /os/platforms/v1/index.html | |
parent | fa3d894172103ab1036140f7f0a61a5c0689f9ab (diff) |
new pi-builder
Diffstat (limited to 'os/platforms/v1/index.html')
-rw-r--r-- | os/platforms/v1/index.html | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/os/platforms/v1/index.html b/os/platforms/v1/index.html index 399d2e89..87281e88 100644 --- a/os/platforms/v1/index.html +++ b/os/platforms/v1/index.html @@ -36,15 +36,31 @@ function onWsMessage(message) { } } +function onKeyPress(event) { + console.log("key pressed: ", event); + let e = event || window.event || arguments.callee.caller.arguments[0]; +// ws.Send("EVENT press " + e.keyCode); +} + +function onKeyRelease(event) { + console.log("key released: ", event); + let e = event || window.event || arguments.callee.caller.arguments[0]; +// ws.Send("EVENT press " + e.keyCode); +} + ws = new WebSocket("ws://" + location.host + "/kvmd/ws"); ws.onmessage = (message) => onWsMessage(message); ws.onerror = (error) => console.error(error); ws.onclose = () => console.log("closed"); + +//https://www.codeday.top/2017/05/03/24906.html +document.onkeydown = onKeyPress; +document.onkeyup = onKeyRelease; </script> <body> <div class="screen"> - <img src="/video/?action=stream" id="stream-image" class="screen-image" alt="" /> + <img src="/streamer/?action=stream" id="stream-image" class="screen-image" alt="" /> </div> </body> </html> |