0

I am writing menu logic and was wondering if there are any general rules for when an on-screen button's function should trigger on release, vs when to trigger on press?

(A release trigger requires a press and a release while still hovering over the button. Most buttons follow this behavior I've noticed. A press trigger fires the moment the mouse button or key is pressed down.)

Primarily, I'm wondering how to handle keyboard presses, since cursor+clicking isn't the only way to press buttons in my menu. A user can also use the arrow keys to select different buttons. If they hit the "Confirm" button (space or another key), should this too only trigger on release, or should it trigger the moment it's pressed since it's using the cursor?

1 Answer 1

1

Anecdotal answer, since I do not have the reputation to comment:

It seems intuitive to have a mouse click trigger on release, and a key trigger on press.

Consider the actions of mouse and keyboard in other contexts: Dragging with the mouse confirms an action after releasing, and all web browsers I know will only trigger a button if the mouse is both clicked and released on the button. On the other hand, pressing a key in a text editor will immediately place the associated character (or perform other actions), while holding a key will repeatedly place the character.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.