Page 1 of 1
Touchscreen scrolling
Posted: Wed Nov 07, 2012 10:58 pm
by cenglish
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
Posted: Thu Nov 08, 2012 1:58 am
by Mark
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.
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
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