Conflict between iPad gestures and mouse actions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 4
- Joined: Fri May 13, 2011 4:54 pm
Conflict between iPad gestures and mouse actions
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
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
Re: Conflict between iPad gestures and mouse actions
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.
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
HyperActive Software | http://www.hyperactivesw.com
Re: Conflict between iPad gestures and mouse actions
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
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
-
- VIP Livecode Opensource Backer
- Posts: 4
- Joined: Fri May 13, 2011 4:54 pm
Re: Conflict between iPad gestures and mouse actions
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
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
Re: Conflict between iPad gestures and mouse actions
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
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
-
- VIP Livecode Opensource Backer
- Posts: 4
- Joined: Fri May 13, 2011 4:54 pm
Re: Conflict between iPad gestures and mouse actions
Many thanks for this.
Richard
Richard