Mouse messages in scrollers

scott at elementarysoftware.com scott at elementarysoftware.com
Tue Sep 15 21:30:06 EDT 2020


on mobile (just iOS at the moment) I’m trying to not only register a horizontal swipe in a UIScroller but to calculate the line in the field under the scroller so that I can perform a delete action. I can get the swipe but… while these calculations seem to work fairly well in the IDE, not so much in the simulator.  both the mouseH and the mouseLoc report a value but when I check it during scrollerDidScroll the X value is always 0 and the Y value is always the bottom of the screen… which of course is not particularly helpful. Am I doing something wrong or is this just not available when a scroller is under the “mouse”? Setting delayTouches and canCancelTouches to false doesn’t appear to change anything. 

—
Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web       https://elementarysoftware.com/
email     scott at elementarysoftware.com
booth    1 360 734 4701


> On May 21, 2020, at 1:22 PM, J. Landman Gay via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> It was "delayTouches" mostly. Default is true, I had to set it to false. I also set canCancelTouches to false but didn't test how necessary that was. Default for that is also true.
> 
> This allowed messages to pass through to LC, but you had to very deliberately swipe, holding down a moment so the mouseDown would fire. Brian Milby came up with a faster solution using something like Jim MacConnell's suggestion -- make the contentRect wider than the group so that a horizontal swipe triggers scrollerDidScroll. Lock direction to vertical to prevent wiggle. That proved to be a the solution for a more natural swipe.
> 
> You have to branch for Android because it doesn't have a lockDirection property; for that OS keep the contentRect the same width as the group. Mouse messages pass through to LC automatically, which is good because the above two settings don't exist on Android.
> 
> Swiping is such a normal behavior on mobile, I'd like to see an easier method in LC to accomodate all this.
> 
> 
> On 5/19/20 8:00 PM, scott--- via use-livecode wrote:
>> You have probably already looked at these but here are (some of) the scroller settings I use for the below-mentioned field:
>> ----------------
>> mobileControlSet sScrollerId, "pagingEnabled", "false"
>> mobileControlSet sScrollerId, "decelerationRate", "normal" -- fast --iOS only
>> mobileControlSet sScrollerId, "canScrollToTop", "true"
>> mobileControlSet sScrollerId, "delayTouches", "false"
>> mobileControlSet sScrollerId, "canCancelTouches", “true"
> 
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com












More information about the use-livecode mailing list