From f329f207f7314d92c817671d64678dfc7f86ec4a Mon Sep 17 00:00:00 2001 From: core Date: Sat, 15 Apr 2023 14:33:03 -0400 Subject: [PATCH] wasd --- client/src/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/index.ts b/client/src/index.ts index 48a08fc93a232cef0d7f0ab535d9bcb83f1a1585..bcbd33c73f3e69bbda6087356e5f97134d74f54a 100644 --- a/client/src/index.ts +++ b/client/src/index.ts @@ -90,13 +90,13 @@ async function client_main(server: string, username: string, texture_quality: st global.canvas.style.setProperty("background-image", `url("/assets/final/${texture_quality}/starfield.png")`); document.onkeydown = (e) => { - if (e.code == "ArrowLeft") { // arrow-left + if (e.code == "ArrowLeft" || e.code == "KeyA") { // arrow-left global.keys.left = true; - } else if (e.code == "ArrowRight") { // arrow-right + } else if (e.code == "ArrowRight" || e.code == "KeyD") { // arrow-right global.keys.right = true; - } else if (e.code == "ArrowUp") { // arrow-up + } else if (e.code == "ArrowUp" || e.code == "KeyW") { // arrow-up global.keys.up = true; - } else if (e.code == "ArrowDown") { // arrow-down + } else if (e.code == "ArrowDown" || e.code == "KeyS") { // arrow-down global.keys.down = true; } @@ -110,13 +110,13 @@ async function client_main(server: string, username: string, texture_quality: st global.client?.socket.send(encode(MessageC2SInput_packetInfo.type, msg)); } document.onkeyup = (e) => { - if (e.code == "ArrowLeft") { // arrow-left + if (e.code == "ArrowLeft" || e.code == "KeyA") { // arrow-left global.keys.left = false; - } else if (e.code == "ArrowRight") { // arrow-right + } else if (e.code == "ArrowRight" || e.code == "KeyD") { // arrow-right global.keys.right = false; - } else if (e.code == "ArrowUp") { // arrow-up + } else if (e.code == "ArrowUp" || e.code == "KeyW") { // arrow-up global.keys.up = false; - } else if (e.code == "ArrowDown") { // arrow-down + } else if (e.code == "ArrowDown" || e.code == "KeyS") { // arrow-down global.keys.down = false; }