- Joined
- Nov 30, 2015
- Messages
- 3
- Reaction score
- 6
- First Language
- English
- Primarily Uses
- N/A
Right now, I'm using a bunch of if statements in the update function to check for keys.
if (Input.isPressed("up")){
}else if (Input.isPressed("down")){
}else if (Input.isPressed("left")){
} else if (Input.isPressed("right")){
}
The problem is, sometimes a key is missed if I tap it too fast.
Would it be a okay if I added my own key listener instead of using the input class, or is that not okay?
if (Input.isPressed("up")){
}else if (Input.isPressed("down")){
}else if (Input.isPressed("left")){
} else if (Input.isPressed("right")){
}
The problem is, sometimes a key is missed if I tap it too fast.
Would it be a okay if I added my own key listener instead of using the input class, or is that not okay?
Code:
document.addEventListener('keydown', somemethod);

