Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Action on MouseClicked vs MouseReleased


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 cmasupra   Members   -  Reputation: 145

Like
0Likes
Like

Posted 08 April 2012 - 05:25 PM

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?

Sponsor:

#2 Neglected   Members   -  Reputation: 111

Like
0Likes
Like

Posted 08 April 2012 - 05:55 PM

Definitely MouseReleased. ><

#3 smasherprog   Members   -  Reputation: 432

Like
0Likes
Like

Posted 08 April 2012 - 08:26 PM

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.
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.

#4 Endurion   Crossbones+   -  Reputation: 3654

Like
1Likes
Like

Posted 08 April 2012 - 11:07 PM

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.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

#5 cmasupra   Members   -  Reputation: 145

Like
0Likes
Like

Posted 08 April 2012 - 11:12 PM

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.

#6 mhagain   Crossbones+   -  Reputation: 8142

Like
0Likes
Like

Posted 09 April 2012 - 06:14 AM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS