How to detect when only one (or a select few) keys are being pressed?

Let's say I want to find out if the player is pressing the g key, but I don't want the player to be able to just slam their arm on the keyboard and press all of them. How can I detect when only a specific key is being pressed, and none of the others?

I'm sure someone will come up with a more elegant way, but I'd be inclined to do this:


This will report True if exactly one key is pressed.

the key pressed block hasn't been with a static input for a few years now, so couldn't you just put the list directly in the block?

Yup. See, I knew someone would find a more elegant way! :~)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.