cannot use two finger scroll in a scrolling group

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 186
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

cannot use two finger scroll in a scrolling group

Post by kaveh1000 » Wed Jan 09, 2019 3:01 pm

How can I use two finger scrolling in a scrolling group? Please see attached minimal example.
Attachments
scrolling in groups.zip
(828 Bytes) Downloaded 11 times
Kaveh

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2293
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: cannot use two finger scroll in a scrolling group

Post by jmburnod » Wed Jan 09, 2019 3:41 pm

Hi Kaveh,
I think you have to play with rawkeydown
Just rename your group to "grMyGroup" and copy this script to your group script

Code: Select all

local sCurScrollGr
on mouseenter
   put "grMyGroup" into sCurScrollGr
end mouseenter

on rawkeydown pRawKey
   put "65309,65308" into tLesK
   if pRawKey is in tLesK then
      put 48 into tEmpan
      if sCurScroll <> empty then
         if the mouseloc is within the rect of group sCurScrollGr then
            if pRawKey = 65308 then
               put tEmpan into tSec
            end if
            if pRawKey = 65309 then
               put (0-tEmpan) into tSec
            end if
            set the vscroll of group sCurScrollGr to (the vscroll of group sCurScrollGr)+tSec
         end if
      end if
   else
      pass rawkeydown
   end if
end rawkeydown
Best regards
Jean-Marc

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 186
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: cannot use two finger scroll in a scrolling group

Post by kaveh1000 » Wed Jan 09, 2019 3:54 pm

Thank you very much Jean-Marc. That works!

I was hoping there would be native support for two finger scrolling...

Regards
Kaveh
Kaveh

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2293
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: cannot use two finger scroll in a scrolling group

Post by jmburnod » Wed Jan 09, 2019 3:57 pm

Glad it works :D
I see

Code: Select all

    put 48 into tEmpan
You can use the height of your btns and the margin between them to define the value of tEmpan
Jean-Marc

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 186
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: cannot use two finger scroll in a scrolling group

Post by kaveh1000 » Tue Jan 15, 2019 5:52 pm

Hi Jean-Marc

Just a note that today I noticed that in a field in a group that I was using your code for, I could not type a capital A. Although mousedown saw the letter, it did not show in the field.

After tearing my hair out for a while, I found that the culprit was:

Code: Select all

put "65309,65308" into tLesK
   if pRawKey is in tLesK then
So Cap A is 65 and it was caught by the lines!!

I changed to:

Code: Select all

 if pRawKey is  65309 or pRawKey is 65308 then
otherwise it is working well. :-)
Kaveh

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2293
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: cannot use two finger scroll in a scrolling group

Post by jmburnod » Tue Jan 15, 2019 5:57 pm

Hi Kaveh,
Sorry for your hairs.
good catch i will correct this in my stack
Best
Jean-Marc

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2293
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: cannot use two finger scroll in a scrolling group

Post by jmburnod » Thu Jan 17, 2019 12:20 pm

Hello,
"among the items of" is a useful way
...
if pRawKey is among the items of "65309,65308" then
...
Best
Jean-Marc

Klaus
Posts: 10744
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: cannot use two finger scroll in a scrolling group

Post by Klaus » Sun Jan 20, 2019 10:35 am

Hi Kaveh,
kaveh1000 wrote:
Wed Jan 09, 2019 3:54 pm
I was hoping there would be native support for two finger scrolling...
get used to the fact that YOU are now the programmer and YOU are supposed to provide "native" support to your user(s)! And LC ist still a programming environment. 8)


Best

Klaus

Post Reply

Return to “Mac OS”