-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathexample-keys.html
51 lines (45 loc) · 1.24 KB
/
example-keys.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title>Example - Hello</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Replace with a separate style.css file if you want -->
<style type="text/css">
body {
background: black;
color: white;
}
</style>
<!-- These 2 script tags are required for the 3D effect.
You can remove these if you disabled THREE_SETTINGS. -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "./three-0.156.1/three.module.min.js",
"three/addons/": "./three-0.156.1/addons/"
}
}
</script>
<script type="module">
import * as qx from "./qx82/qx.js";
import * as qxa from "./qx82/qxa.js";
async function main() {
// Clear screen.
qx.color(7, 1);
qx.cls();
qx.locate(1, 8);
qx.print("Type a key to show its name:\n");
while (true) {
const keyName = await qxa.key();
qx.locate(1, 10);
qx.color(14);
qx.print(keyName + " ");
}
}
window.addEventListener("load", () => qx.init(main));
</script>
</head>
<body>
</body>
</html>