Smooth scrolling
Niggemann, Bernd
Bernd.Niggemann at uni-wh.de
Fri Feb 5 05:09:12 EST 2021
> Trevor wrote
>
> On macOS it is simple enough to get the true scroll values from the scroll
> event using NSEvent.scrollingDeltaX and NSEvent.scrollingDeltaY. It is
> possible to get those values using LCB as demonstrated in the
> mac_scroll_wheel.lcb extension that is included with the DataView control
> I've made available. Here is a link to the source code:
>
> https://github.com/trevordevore/levurehelper-dataview/blob/develop/mac_scroll_wheel.lcb
> .....
> Ideally any engine improvements would tap into the
> scroll wheel values provided by the OS.
Thank you Trevor for making this available. After testing your library i realize what an improvement it is.
And I agree that "ideally any engine improvents would tap into the scroll wheel values provided by the OS"
I don't see any difference regarding lineSize. Maybe "ObjC_NSEventHasPreciseScrollingDeltas" is true.
Anyway in the comments of the LCB file you mention "row height"
Do you mean "effectiv lineSize" (synonym of borderSize) or "effective textHeight"?
I added hScroll to your script (again this is Mac only and needs Trevor's library installed)
-------------------------------------------
on rawKeyDown pKey
-- if the optionKey is down then pass rawKeyDown -- just to test scrolling of LC and library
if pKey = "65308" or pKey = "65309" then
set the vscroll of me to the vscroll of me \
- item 2 of macCurrentEventScrollValues(the effective linesize of me)
else if pKey is in "65310,65311" and the hScrollbar of me then
set the hscroll of me to the hscroll of me \
- item 1 of macCurrentEventScrollValues(the effective linesize of me)
else
pass rawKeyDown
end if
end rawKeyDown
--------------------------------------------
Kind regards
Bernd
More information about the use-livecode
mailing list