We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67e7dae commit 6667358Copy full SHA for 6667358
1 file changed
12 - Key Sequence Detection/index-START.html
@@ -1,12 +1,33 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
+
4
<head>
5
<meta charset="UTF-8">
6
<title>Key Detection</title>
7
<script type="text/javascript" src="https://www.cornify.com/js/cornify.js"></script>
8
</head>
9
10
<body>
-<script>
-</script>
11
+ <script>
12
+ const seq = "fakeha";
13
+ const pressed = [];
14
+ let test = "";
15
16
+ window.addEventListener("keyup", (e) => {
17
+ pressed.push(e.key);
18
+ pressed.splice(-seq.length - 1, pressed.length - seq.length);
19
+ test = pressed.join("");
20
21
+ if (test.includes(seq)) {
22
+ console.log("youre correct");
23
+ //pressed.splice(0);
24
+ cornify_add();
25
+ }
26
27
+ console.log(e.key);
28
29
+ })
30
+ </script>
31
</body>
-</html>
32
33
+</html>
0 commit comments