Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
I want to move my pointer away from a button after someone has clicked on it (so that someone with twitchy fingers doesn't keep clicking on it), and am well aware that I can do something like this:
I have always wished that the mouseLoc was more than read-only. Why the screenMouseLoc works both ways and not the mouseLoc has always bothered me.
Anyway, you have to involve "stack coordinates" to find a suitable loc within a card. Klaus alluded to this in his handler. I would move the cursor to a loc nicely just off the control of interest, instead of to an arbitrary value, which in a small card may not even be visible, or in the middle of another control, or something worse.
on mouseUp
local tTopLeftOfStack
local tTopRightOfTarget
local tNewMouseLoc
put the topLeft of this stack into tTopLeftOfStack
put the topright of target into tTopRightOfTarget
--create new screenMouseLoc
put item 1 tTopLeftOfStack + item 1 tTopRightOfTarget & "," into tNewMouseLoc
put item 2 tTopLeftOfStack + item 2 tTopRightOfTarget after tNewMouseLoc
set the screenMouseLoc to tNewMouseLoc
end mouseUp
richmond62 wrote: Sun Oct 13, 2024 3:08 pm
I want to move my pointer away from a button after someone has clicked on it (so that someone with twitchy fingers doesn't keep clicking on it), and am well aware that I can do something like this:
I prefer the disabled suggestion. Moving the mouse is disorienting for the user and not recommended. I'd disable the button on mouseUp and re-enable it after a short delay. And sometimes just blocking mouseDoubleUp is enough.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Agreed - it should be like online transactions for example. Once you click submit, the button is disabled to prevent you from being changed multiple times. It would be weird if the mouse moved off the button... and it still wouldn't stop me from clicking twice...
local tRandomPosition
put random(the width of this stack), \ -- X
random(the height of this stack) \ -- Y
into tRandomPosition
set the screenMouseLoc to globalLoc(tRandomPosition)
Sure, but if you follow the thread here I think you will agree that standard user interface practice recommends the disable method. I always get hung up on solving the posted issue with LC tools, rather than thinking more broadly. I leave that sort of thing to Jacque, oh, and you.