Determining left or right movement in a mouseMove handler
Mark Schonewille
m.schonewille at economy-x-talk.com
Tue Jun 27 06:58:31 EDT 2017
Hoping I didn't mix up the x's and y's, I believe the script you need
looks like this:
local myOldX,myOldY
on mouseMove theNewX,theNewY
if myOldX < theNewX then put
"right" into myMovement
else
put "left" into myMoveMent
end if
if myOldY > myNewY then put
"down" into myMoveMent
else
put "up" into myMoveMent
end if
// do something with right, left,
// up and down here.
put theNewX into myOldX
put theNewY into myOldY
pass mouseMove
end mouseMove
Kind regards,
Mark Schonewille
http://economy-x-talk.com
https://www.facebook.com/marksch
Buy the most extensive book on the
LiveCode language:
http://livecodebeginner.economy-x-talk.com
Op 27-Jun-17 om 12:32 schreef Michael Kristensen via use-livecode:
> Hi there
>
> How can I determine if the mouse is moving left or right (or up or down) on the screen in a mouseMove handler?
>
> Not just from the outset (that is easy) but at any moment, like when a user changes his mind and move the opposite way.
>
> Something like put x into oldX will not work.
>
> Thanks
> Michael
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list