This works for me, though you might need to adjust 'tStepsize':
--in group script
on rawKeyDown pKey
if the short name of me is not in the long name of target then
pass rawkeydown
else
put 45 into tStepSize -- adjust here the stepsize for scrolling
switch pKey
case "65309" -- scroll up
set the vscroll of me to the vscroll of me - tStepSize
break
case "65308" -- scroll down
set the vscroll of me to the vscroll of me + tStepSize
break
end switch
end if
pass rawkeydown
end rawKeyDown
(In light of the recent copyright discussion going on here, I would like to
disclose that I 'borrowed' this entirely a few years ago, and can't remember
where; so apologies and thanks to the actual author.)
There are also a few similar examples in the "rawkeydown/up" entries in the
Livecode Dictionary.
Mac
On Aug 2, 2013, at 10:53 AM, Devin Asay <[email protected]> wrote:
> Alex
> On Aug 2, 2013, at 2:43 AM, Alex Tweedly wrote:
>
>> On OSX (10.8.4, MBP - but I doubt that matters), I can scroll using a
>> two-finger touch (i.e. if the cursor is within an area that is scrollable,
>> then generally I can touch with two fingers, and 'push up' or 'pull down'
>> the window contents.
>>
>> This includes LC fields - this scrolling "just works" for them.
>>
>> If I create a group, set and lock its position and give it a scrollbar, then
>> it gets the scrollbar, and all the traditional behaviour associated with
>> that (i.e. the scrollbar can be dragged, etc.)
>>
>> But it doesn't automatically get the two-finger touch behaviour.
>>
>> Is there some way I can enable that ? Do I need to program this myself ?
>>
>> It looks as though the "touchStart, touchEnd, etc. are implemented on mobile
>> only, so I'm not sure where to start.
>
> I believe you have to handle scroll wheel actions using rawKeyDown or
> rawKeyUp (I forget which, and I'm not in a place I can check right now.) Just
> figure out which codes get sent when the scroll wheel is used and set the
> scroll of the group in your handler.
>
> HTH
>
> Devin
>
>
> Devin Asay
> Office of Digital Humanities
> Brigham Young University
>
>
> _______________________________________________
> use-livecode mailing list
> [email protected]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode