joebiden @joebiden

any javascript soldiers know how to put an onevent style input into an if statement? like if input = rightArrow ty shii

Mar 27, 2023, 3:42 PM
2

comments

// code by the code witch lily :3

var keys = {};

document.addEventListener("keydown", (event) => {keys[key] = true});
document.addEventListener("keyup", (event) => {keys[key] = false});

function tick() {
  if (keys["e"]) alert("haii world! :3");
}