Should I use the input class, or my own key listener?

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?

Code:
document.addEventListener('keydown', somemethod);
I don't foresee any issues.
I use Input.isTriggered('right') { } etc... 


You use pages or states if you're just using coding. If you're using rpg maker mv eventing, you just use pages. 


somefunction.prototype.update {
if (page == 1) { set up, then page = 2 }
if (page == 2) { if (Input.isTriggered('ok') { page = 3 } }
if (page == 3 { process result }
}




Very easy, no problem with what's there, unless you need access to more keys, although that's what all of these amazing plugins that are already out are for. Depends though if you'd like to do it on your own, but you asked "do you think I would need to?" and I think the answer is no to that, you don't NEED to. You CAN if you want to practice programming. ; p

Original thread: https://forums.rpgmakerweb.com/threads/should-i-use-the-input-class-or-my-own-key-listener.61675/