side effect on mac with LC
Yves COPPE
yvescoppe at mac.com
Tue Jan 17 18:23:50 EST 2017
Hi,
I will try it tomorrow
Thank you
Greetings.
Yves COPPE
yvescoppe at mac.com
What you can do is the following:
When the user pushes down you register the horisontal position of the pointer and store this position for later use. This can be stored in a variabel or a custom property like this:
global gStartH
on mouseDown
put the mouseH into gStartH
end mouseDown
//You then control whether the pointer has been moved or not in a mouseUp handler, decide how far it should move before you slide
on mouseUp
if the mouseH > (gStartH + 100) then //has moved more than 100 pixels
lock screen for visual effect
go next card
unlock screen with visual effect push right fast
end if
if the mouseH < (gStartH-100) then //has moved more than 100 pixels
lock screen for visual effect
go previous card
unlock screen with visual effect push left fast
end if
end mouseUp
If you like you can check while the mouse is moving with the following script (in stead of mouseUp):
on mouseMove
if the mouse is down and the mouseH > (gStartH + 100) then //has moved more than 100 pixels
lock screen for visual effect
go next card
unlock screen with visual effect push right fast
end if
if the mouse is down and the mouseH < (gStart -100) then //has moved more than 100 pixels
lock screen for visual effect
go previous card
unlock screen with visual effect push left fast
end if
end mouseMove
If you put this script in the stack, you need to make sure that the card or other objects do not trap the mouse messages.
Regards
Tore Nilsen
More information about the use-livecode
mailing list