MouseUp or MouseDown?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
MouseUp or MouseDown?
I've long been intrigued by the default
"on mouseUp" since "on mouseDown" seems
more intuitive and I've recently found that
in some cases "mouseDown" works better.
Is there some history in the use of "mouseUp"?
"on mouseUp" since "on mouseDown" seems
more intuitive and I've recently found that
in some cases "mouseDown" works better.
Is there some history in the use of "mouseUp"?
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: MouseUp or MouseDown?
With push buttons on most OSes, the release of the mouse is the action trigger. Your can observe this by clicking down on a push button, and while the mouse is still down, drag off the button to release.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: MouseUp or MouseDown?
What Richard said, in terms of "normal" UI expectations. If you play around with any of your other favorite apps, you will probably see that it is "up" where the actual instant of action occurs.
But this is academic. LC offers it all, including "mouseWithin" and "mouseStillDown"
Craig Newman
But this is academic. LC offers it all, including "mouseWithin" and "mouseStillDown"
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: MouseUp or MouseDown?
The reason all OSs use mouseUp by default is to allow the user to cancel the button press by dragging outside the control before release. It's a handy convention when you change your mind in the middle of a click.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: MouseUp or MouseDown?
I can't recall ever changing my mind mid-click
but perhaps one day...
Don't see anything in the Dictionary about
using left or right (or middle) mouse button.
Have I missed something?
but perhaps one day...
Don't see anything in the Dictionary about
using left or right (or middle) mouse button.
Have I missed something?
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
Re: MouseUp or MouseDown?
Standard click behaviour:
Usually what we call a "simple" click is a left-click.
Right-clicks usually evokes a popup menu of some sort (context menu).
But you can of course script what you like!
If you omit the "pMouseButton" parameter i a "mouseup/down" handler then a left-click is presumed by the engine.
Parameter for "mouseup/down" handler:
1 = left click
2 = middle click, which most "mouses" do not have
3 = right-click
Examples:
Code: Select all
on mousedown pMousebutton
if pMouseButton = 3 then
popup btn "my popup menu" at the mouseloc
end if
end mousedown
Code: Select all
on mouseup
## Same as -> on mouseup 1
beep
end mouseup
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: MouseUp or MouseDown?
Hi Ross,
There is a something about that in LC dictionary at "mouseup" entry
Edit: I tried to delete my this post with a comment "Herr Major was faster than me" and I got this message: "Sorry but you may only delete posts which have not been replied to."
Something change about delete message ?
Best regards
Jean-Marc
There is a something about that in LC dictionary at "mouseup" entry
Edit: I tried to delete my this post with a comment "Herr Major was faster than me" and I got this message: "Sorry but you may only delete posts which have not been replied to."
Something change about delete message ?
Best regards
Jean-Marc
Last edited by jmburnod on Fri Jun 08, 2018 10:03 pm, edited 1 time in total.
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: MouseUp or MouseDown?
In the Dictionary entries for most mouse-related messages (mouseDown, mouseUp, mouseDoubleDown, etc.) you'll see an argument passed with the message identified as mouseButtonNumber. Just below in the "Parameters" section you'll find the discussion of how the integer passed there reflects the button number: 1 for left-click, 2 for middle-click (though not as common outside of Unix where three-button mice are the standard), and 3 for right-click.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: MouseUp or MouseDown?
I was merrily using mouseDown all the time in 2004 until Klaus
pointed out that by using mouseUp the end-user gets
a chance to change her mind by sliding her mouse pointer off the object
before releasing it.
It is also useful in this sort of scenario (pseudocode):
on mouseDown
do one action
end mouseDown
on mouseUp
perform another action
end mouseUp
and, in my case, more specifically (real code):
pointed out that by using mouseUp the end-user gets
a chance to change her mind by sliding her mouse pointer off the object
before releasing it.
It is also useful in this sort of scenario (pseudocode):
on mouseDown
do one action
end mouseDown
on mouseUp
perform another action
end mouseUp
and, in my case, more specifically (real code):
Code: Select all
on keyDown KD
put (KD && "= ") into fld "fKEY"
end keyDown
on rawKeyUp RK
put RK after fld "fKEY"
end rawKeyUp
Re: MouseUp or MouseDown?
Regarding "on mouseUp" allowing the user to
change his/her mind before releasing the
button isn't it normal for a programme to
allow the user to "undo" a wrong click?
So I find the argument for "on mouseUp" is
pretty feeble.
change his/her mind before releasing the
button isn't it normal for a programme to
allow the user to "undo" a wrong click?
So I find the argument for "on mouseUp" is
pretty feeble.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: MouseUp or MouseDown?
"Undo" is invaluable.
Moving the mouse off the target while still down to cancel an errant or mistaken click. priceless.
Craig
Moving the mouse off the target while still down to cancel an errant or mistaken click. priceless.
Craig
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: MouseUp or MouseDown?
It should be: but I, for one, don't know how one sets up codeisn't it normal for a programme to
allow the user to "undo" a wrong click?
in LiveCode so every mouseclick is undoable after the click.
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: MouseUp or MouseDown?
By using mouseUp instead of mouseDown.richmond62 wrote: ↑Sun Jun 10, 2018 7:58 amIt should be: but I, for one, don't know how one sets up codeisn't it normal for a programme to
allow the user to "undo" a wrong click?
in LiveCode so every mouseclick is undoable after the click.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: MouseUp or MouseDown?
Really? Gosh? Wow? I would never have guessed.By using mouseUp instead of mouseDown
Some other people in this discussion seem not to have got "there" either.
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: MouseUp or MouseDown?
It's actually a documented behavior in Apple's Human Interface Guidelines from back when it created the earliest personal computers, and they gave the reason as above. This was back when Apple did extensive usability testing and developed interfaces that were later copied by Microsoft and have now become the expected standard.
While experienced users may not need the behavior as much, watch any new user learning a computer for a while, or a motor-impaired user with Parkinson's or CP. Clicks and mousing are slow, and mistaken mouse movements are common. The ability to abort an unintended gesture is useful, especially if the result would be an unwanted long process or data modification.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com