statki/public/assets/js/key_handling.js

13 lines
282 B
JavaScript

document.addEventListener("keydown", (e) => {
switch (e.code) {
case "KeyB":
switchBoards();
break;
case "KeyS":
switchShips();
break;
case "KeyR":
switchRotation();
break;
}
});