- Home /
EventType.MouseUp seems to dislike buttons
Simple code:
void OnGUI () {
if( e.type == EventType.MouseUp ){
print( "mouse up!" );
}
}
The "mouse up!" message only appears when I mouse up and the cursor is NOT over a button.
Basically, I've got a button that I need to use to track clicks and click-drags.
So the element is a GUILayout.RepeatButton(), and when you click and drag, it allows for moving of the element, while clicking or double clicking has other effects-- so, I've got to determine click states on my own. The point of the mouseup event thing is to look for these complete clicks after an isPressed boolean has been set by pressing the button.
Because the mouseup event type doesn't seem to fire when the cursor is over a button, I can't track said complete clicks.
Whatcha think?
Answer by Sinaz20 · Apr 19, 2012 at 08:13 PM
I've worked around this by using Input.GetMouseButtonUp().
Your answer
![](https://koobas.hobune.stream/wayback/20220613070503im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Detect mouse up or end of drag on any scene object 0 Answers
'EventType' does not contain definition for "MouseUp" 1 Answer
Detecting MouseUp event when the mouse is not over an EditorWindow 1 Answer
Preventing editor deselect on MacOS 1 Answer
Gui.modalWindow catch mouseUp event outside of the window 0 Answers