Added check for button combo (will exit app in future)

This commit is contained in:
Vaclav Siml 2023-02-24 20:35:04 +01:00
parent 9412091524
commit d6154ad3f5

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -7,6 +8,7 @@
<link rel="stylesheet" href="style.css">
<title>UI</title>
</head>
<body>
<script src="Vars.js">
</script> <!--Loadne Vars.js-->
@ -41,13 +43,6 @@
</div>
</div>
<!-- <audio id="Switchfocus">
<source src="Audio/switchfocus.mp3" type="audio/mpeg">
</audio>
<audio id="Audiostart">
<source src="Audio/audiostart.mp3" type="audio/mpeg">
</audio> -->
<script>
const prvnihra = [...document.querySelectorAll("button")]
@ -102,7 +97,24 @@
//document.body.requestFullscreen();
})
let keysPressed = {};
document.addEventListener('keydown', (event) => {
keysPressed[event.key] = true;
if (keysPressed[ExitKey1] && event.key == ExitKey2) {
alert(event.key);
}
});
document.addEventListener('keyup', (event) => {
delete keysPressed[event.key];
});
</script>
<script>
var vers = 0; /* Handles Running of apps */
const { execFile, exec, spawn } = require('child_process');