Jump to content
  • Advertisement
Sign in to follow this  

Action on MouseClicked vs MouseReleased

This topic is 2232 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was thinking today about what would be a better trigger to activate buttons: mouse clicked or mouse released. By this I mean, would it be better to have the button do its action when the user clicks their mouse down on it, or when the user releases their mouse on it?

Pros for MouseClicked:
1) Faster reaction to the user clicking the button

Pros for MouseReleased:
1) The user can drag their mouse away from the button if they didn't actually want to click it

I clearly didn't think of very much. Maybe that means it's a stupid topic, but what are you guys' opinions on which one is better?

Share this post


Link to post
Share on other sites
Advertisement
The standard is to have the action actually happen only on a completed MouseDown and a matching Mouseup. This is important. If a user is Clicks and holds the mouse button down, then drags and releases over a button, the event should not fire off. It should only happen if the button is already in the pressed position.

Share this post


Link to post
Share on other sites
Additionally to what smasherprog said, also the reverse: If the mouse button is pressed and helf over a button, the user drags the cursor off the button and releases it, the event should also not fire off.

If in doubt, compare with your OS behaviour. People prefer common behaviour.

Share this post


Link to post
Share on other sites

The standard is to have the action actually happen only on a completed MouseDown and a matching Mouseup. This is important. If a user is Clicks and holds the mouse button down, then drags and releases over a button, the event should not fire off. It should only happen if the button is already in the pressed position.

Interesting. I knew of the of the problem with clicking and dragging to another button and then releasing, causing the button to activate. I didn't know that what you described was standard. It definitely makes sense, though.

Share this post


Link to post
Share on other sites

If in doubt, compare with your OS behaviour. People prefer common behaviour.


This is important. If people are used to the mouse behaving a certain way in their OS, if a program comes along and behaves a different way, the end result is user confusion/unhappiness and added support overhead.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!