What's the best way to assign keyboard key priority?

To put it simple, I am trying to make WASD keys prevent the use of zxc if any one of the WASD keys are pressed.

Ive gone through a few methods using delays and setting variables, but it seems like Im stretching on endlessly for such a simple things.

Is there something I’m overlooking that could make this easier, such as an array?

Sorry for my ignorance but I wanted to see if there’s a more refined way.