Equivalent of command click in iOS
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Equivalent of command click in iOS
I want to make a hidden button in an iOS version that only reacts if a key or key combination is pressed while the button is clicked, such as:
if the shift key is down then
do this
end if
but how do I do something like that in an iOS version?
Thanks
David
if the shift key is down then
do this
end if
but how do I do something like that in an iOS version?
Thanks
David
Re: Equivalent of command click in iOS
Well, I don't think we have a force touch capability, yet, but it is requested, in bug 17185.
look up "mousestilldown". If the user holds their finger for an extended period, would that work?
You could also track multiple touches in short succession, with a bit of scripting.
look up "mousestilldown". If the user holds their finger for an extended period, would that work?
You could also track multiple touches in short succession, with a bit of scripting.
Re: Equivalent of command click in iOS
Thanks. That should work!
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Equivalent of command click in iOS
This is fun.
But if find that neither of the following two handlers are stable, that is, they do not fire reliably. In a button script:
But this works:
Craig Newman
But if find that neither of the following two handlers are stable, that is, they do not fire reliably. In a button script:
Code: Select all
--on mouseStillDown
-- if the mouse is down and the shiftKey is down then answer "both"
--end mouseStillDown
--on mouseWithin
-- if the mouse is down and the shiftKey is down then answer "both"
--end mouseWithin
Code: Select all
on mouseDown
send "testMe" to me
end mouseDown
on testMe
if the mouse is down and the shiftKey is down then
answer "both"
exit to top
end if
send "testMe" to me in 1
end testMe
Re: Equivalent of command click in iOS
The problem was implementing this on ios - no shift key without a keyboard up on screen.
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Equivalent of command click in iOS
Mikey.
Understood. But I only wanted to demonstrate the reliability of a method.
So even on iOS, if a finger is "down" on screen, then you can test for any other simultaneous condition reliably.
I think this makes sense, no? I do not develop for mobile, so I could be out of my depth.
Craig
Understood. But I only wanted to demonstrate the reliability of a method.
So even on iOS, if a finger is "down" on screen, then you can test for any other simultaneous condition reliably.
I think this makes sense, no? I do not develop for mobile, so I could be out of my depth.
Craig
Re: Equivalent of command click in iOS
The other event to be watching out for is mouseLeave
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Equivalent of command click in iOS
Hi
Sometimes I use a timer on iOs where i use command or option key on desktop
What about this in this case ?
Best
Jean-Marc
Sometimes I use a timer on iOs where i use command or option key on desktop
What about this in this case ?
Code: Select all
local sStartTime
on mousedown
put the milliseconds into sStartTime
end mousedown
on mouseUp
if the milliseconds < (sStartTime + 500) then
beep
else
answer "500 milliseconds passed"
end if
end mouseUp
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Equivalent of command click in iOS
Typically on mobile devices, a long-press substitutes for actions that require a modifier key on desktop. Use Jean-Marc"s timer suggestion to determine whether a long-press has occured.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com