Hi,
I have a single button when pressed should add or subtract from a score.
When the button is clicked, it Add 1 to the total, if the user makes a mistake, the user must have the option to double-click or long-click the button to Subtract 1 from the Total.
I have the below code that works in the IDE (Windows), however on Android (touch Screen) the "mouseClick" is not registered.
I also looked at touchStart/End etc, with no success. How can I solve this?
on mouseUp
wait 20 ticks
if the mouseClick then
subtract 1 from fld "TotalScore"
else
add 1 to fld "TotalScore"
end if
end mouseUp
Regards
Marra
Double-click Button on Android Touch Screen
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Double-click Button on Android Touch Screen
Hi Marra,
Best regards
Jean-Marc
This should work:the user must have the option to double-click or long-click the button to Subtract 1 from the Total.
Code: Select all
local sStartTime
on mousedown
put the milliseconds into sStartTime
end mousedown
on mouseUp
if the milliseconds > (sStartTime + 200) then
subtract 1 from fld "TotalScore"
exit mouseUp
else
add 1 to fld "TotalScore"
end if
end mouseUp
Jean-Marc
https://alternatic.ch
Re: Double-click Button on Android Touch Screen
Hi Jean-Marc,
Works perfectly, thank you so much!
BR
Marra
Works perfectly, thank you so much!
BR
Marra