Conflict between iPad gestures and mouse actions

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richardPVP
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4
Joined: Fri May 13, 2011 4:54 pm

Conflict between iPad gestures and mouse actions

Post by richardPVP » Fri May 13, 2011 5:12 pm

I am currently developing my first application for an iPad based on materials I have previously used in alternative software.
I have utilised the code from the "Simple Stock Control" example (putting it into the stack script) which works very well to move forwards and backwards from page to page using the "swipe gesture" in my application. However, on some of my pages I have "drag and drop" activities where children have to move words to match particular photographs (and if they put them in the correct place they "stick" there.) These, also, worked well. However, now I have downloaded the whole code to an iPad my attempt to move the words to the appropriate photographs results in moving to the next or previous card before I can complete the activity! How can I inhibit the left and right gestures so that I can complete the "drag and drop" activities - or is there a major gap in my understanding of LiveCode. (This is extremely likely - although I am impressed with the software that has let me get as far as I have in 3 weeks!!)

Many thanks for your advice.

Best wishes

Richard

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Conflict between iPad gestures and mouse actions

Post by jacque » Fri May 13, 2011 7:25 pm

That's a tough one in any language. I think basically you need to determine whether the user is touching an object or the card itself. If an object, then use your drag scripts. If the card, do a swipe.

You can determine what is under the mouse/finger by checking "the target". If "card" is in the target then the user is swiping.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Conflict between iPad gestures and mouse actions

Post by Dixie » Sat May 14, 2011 9:48 am

Hi...

Read 'Clearing pending interactions' in the iOS 4.6 release notes....

It works for me when wanting to differentiate between 'touch' and 'mouse' messages. I think that the 'iphoneClearTouches' command will solve your problem... I have not tried it in conjunction with 'drag & drop', but if you try calling 'iphoneClearTouches' in the the first line of your drag handler, it might help.

be well

Dixie

richardPVP
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4
Joined: Fri May 13, 2011 4:54 pm

Re: Conflict between iPad gestures and mouse actions

Post by richardPVP » Wed May 18, 2011 2:47 pm

Many thanks for your advice.

When I included 'iphoneClearTouches' into the button handler it was identified as an error in the script. Is this because I am writing for iPad or does this not make a difference ?

Best wishes

Richard

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Conflict between iPad gestures and mouse actions

Post by Dixie » Wed May 18, 2011 3:17 pm

Richard...

It was rather stupid of me in my first post not to be thinking that you are writing for a mobile device, the iPad. But on page 14 of the iOS release notes under the heading 'What doesn't work', it says 'drag-drop related syntax and functionality (no support on mobile devices)'... it is at this point you have your problem laid bare...

be well

Dixie

richardPVP
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4
Joined: Fri May 13, 2011 4:54 pm

Re: Conflict between iPad gestures and mouse actions

Post by richardPVP » Wed May 18, 2011 5:02 pm

Many thanks for this.

Richard

Post Reply