It worked git add .git add .!

This commit is contained in:
Theouche
2024-07-31 17:26:20 +02:00
parent 9fe4e51c53
commit 8ed7cf6419
6 changed files with 31 additions and 9 deletions

View File

@@ -205,14 +205,15 @@ document.addEventListener('DOMContentLoaded', () => {
}
function handleKeyDown(event) {
console.log('Key press: ', event.key);
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
console.log('Key press: ', event.key);
sendKeyPress(event.key.toLowerCase());
}
}
function sendKeyPress(key) {
if (socket.readyState === WebSocket.OPEN) {
console.log('Key sent: ', key);
socket.send(JSON.stringify({ type: 'key_press', key }));
}
}