MZ Check for two keys held simultaneously

Hi everyone,

I'm currently working on a minigame, where you can, simple put, move a picture as a marker on a map. I'm checking for key input and move the picture accordingly.
I'd like to add diagonal movement, but I'm not quite sure how to check, if two keys are held simultaneously. Is there a best practice for that?

Thank you!
if: Input.isPressed('up') && Input.isPressed('left')
Thank you! I knew it would be something like that. I tried Input.isTriggered, but obviously it would require to press both keys in exactly the same frame. Didn't think of the other options.
As another option, I sometimes use Input.dir8 to check for 1 (lower left), 3 (lower right), 7 (upper left), 9 (upper right) when dealing with directional input only:
JavaScript:
if (Input.dir8 === 1) {
  // do this
}
// or
[1, 3].includes(Input.dir8) ? /*do this*/ : /*or this*/ ;
I have a UnifiedFustionBridge plugin which can use to check multiple keys.
so it also directly work with any gamepad in general (which I cannot test yet).

can trigger, press, repeat, release, or check any key in an array.

or if you need to hold it for x frames or repeat the button within X frames.
so you can go crazy on them 🙂 (default mapping are set, but your free
to change it).

so you have your entire keyboard for usage if need.

Original thread: https://forums.rpgmakerweb.com/threads/check-for-two-keys-held-simultaneously.178828/