summaryrefslogtreecommitdiff
path: root/os/platforms/v1/index.html
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-05 15:13:27 +0000
committerDevaev Maxim <[email protected]>2018-07-05 15:13:27 +0000
commit033ad8922c6407bd9e7ca77817afdb4ed40ffc82 (patch)
tree0ac0f0136c44232c37a876066e66013d479d184a /os/platforms/v1/index.html
parentfa3d894172103ab1036140f7f0a61a5c0689f9ab (diff)
new pi-builder
Diffstat (limited to 'os/platforms/v1/index.html')
-rw-r--r--os/platforms/v1/index.html18
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>