slash listen event

This commit is contained in:
Andras Bacsai
2023-05-12 11:17:56 +02:00
parent 4a5ee9342e
commit 5778152e95
3 changed files with 35 additions and 8 deletions

View File

@@ -32,6 +32,15 @@
@auth
<script>
window.addEventListener("keydown", function(event) {
if (event.target.nodeName === 'BODY') {
if (event.key === '/') {
event.preventDefault();
window.dispatchEvent(new CustomEvent('slash'));
}
}
})
function checkIfIamDead() {
console.log('Checking server\'s pulse...')
checkIfIamDeadInterval = setInterval(async () => {