Page 1 of 1
cannot use two finger scroll in a scrolling group
Posted: Wed Jan 09, 2019 3:01 pm
by kaveh1000
How can I use two finger scrolling in a scrolling group? Please see attached minimal example.
Re: cannot use two finger scroll in a scrolling group
Posted: Wed Jan 09, 2019 3:41 pm
by jmburnod
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
Re: cannot use two finger scroll in a scrolling group
Posted: Wed Jan 09, 2019 3:54 pm
by kaveh1000
Thank you very much Jean-Marc. That works!
I was hoping there would be native support for two finger scrolling...
Regards
Kaveh
Re: cannot use two finger scroll in a scrolling group
Posted: Wed Jan 09, 2019 3:57 pm
by jmburnod
Glad it works
I see
You can use the height of your btns and the margin between them to define the value of tEmpan
Jean-Marc
Re: cannot use two finger scroll in a scrolling group
Posted: Tue Jan 15, 2019 5:52 pm
by kaveh1000
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.
Re: cannot use two finger scroll in a scrolling group
Posted: Tue Jan 15, 2019 5:57 pm
by jmburnod
Hi Kaveh,
Sorry for your hairs.
good catch i will correct this in my stack
Best
Jean-Marc
Re: cannot use two finger scroll in a scrolling group
Posted: Thu Jan 17, 2019 12:20 pm
by jmburnod
Hello,
"among the items of" is a useful way
...
if pRawKey is among the items of "65309,65308" then
...
Best
Jean-Marc
Re: cannot use two finger scroll in a scrolling group
Posted: Sun Jan 20, 2019 10:35 am
by Klaus
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.
Best
Klaus