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> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
@ -7,6 +8,7 @@
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
<title>UI</title> <title>UI</title>
</head> </head>
<body> <body>
<script src="Vars.js"> <script src="Vars.js">
</script> <!--Loadne Vars.js--> </script> <!--Loadne Vars.js-->
@ -41,13 +43,6 @@
</div> </div>
</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> <script>
const prvnihra = [...document.querySelectorAll("button")] const prvnihra = [...document.querySelectorAll("button")]
@ -102,7 +97,24 @@
//document.body.requestFullscreen(); //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>
<script> <script>
var vers = 0; /* Handles Running of apps */ var vers = 0; /* Handles Running of apps */
const { execFile, exec, spawn } = require('child_process'); const { execFile, exec, spawn } = require('child_process');