Touchscreen scrolling
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Touchscreen scrolling
I am in the process of switching over an iOS app to desktop, both mac and windows. I have everything working fine, but I am now wanting to put the app on a touchscreen monitor (windows) but I can't seem to figure out how to capture an event for when the user touches the screen. I thought my rawkeydown script would work for it since I needed it for the desktop scrolling, but it just jumps. Any ideas?
Re: Touchscreen scrolling
Hi,
Most touch screen work like a trackpad. They just send mouse messages, such as mouseUp, mouseDown, mouseStillDown, mouseMove etc. Some of them can only invoke mouseDown and mouseUp messages. First look at which messages are sent, then write a script similar to e.g.
This could be a field script. Note that this is only an example. I'm not sure what will work for you. Maybe you don't need to check that the mouse is down, maybe you can't check that the mouse is down. It all depends on the device you use.
Kind regards,
Mark
Most touch screen work like a trackpad. They just send mouse messages, such as mouseUp, mouseDown, mouseStillDown, mouseMove etc. Some of them can only invoke mouseDown and mouseUp messages. First look at which messages are sent, then write a script similar to e.g.
Code: Select all
local lPreviousLoc
on mouseDown
put the mouseLoc lPreviousLoc
end mouseDown
on mouseMove
if the mouse is down then
put the mouseLoc into myNewLoc
if item 1 of myNewLoc > item 1 of lPreviousLoc then
set the hScroll of me to the hScroll of me + 10
else if item 1 of myNewLoc < item 1 of lPreviousLoc then
set the hScroll of me to the hScroll of me - 10
end if
if item 2 of myNewLoc > item 2 of lPreviousLoc then
set the vScroll of me to the vScroll of me + 10
else if item 2 of myNewLoc < item 2 lPreviousLoc then
set the vScroll of me to the vScroll of me - 10
end if
put myNewLoc into lPreviousLoc
end if
end mouseMove
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode