Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,41 @@ end editorExpandVertical

getProp editorExpandVertical
return sExpandVertical
end editorExpandVertical
end editorExpandVertical

on rawKeyDown pKeyNum
-- allow scroll wheel, pgup, & pgdn to scroll the text field
-- bubble up to the parent if at either limit
if the target contains "field" then
local tScrollPosition, tScrollAmount, tScrollMax
put the vScroll of the target into tScrollPosition
put 0 into tScrollAmount
switch pKeyNum
case "65365"
put 45 into tScrollAmount
-- fall through
case "65309"
if tScrollPosition is 0 then pass rawKeyDown
add 5 to tScrollAmount
put max(0, tScrollPosition - tScrollAmount) into tScrollPosition
break
case "65366"
put 45 into tScrollAmount
-- fall through
case "65308"
add 5 to tScrollAmount
put the formattedHeight of the target - \
the height of the target into tScrollMax
if tScrollPosition is tScrollMax then pass rawKeyDown
put min(tScrollMax, tScrollPosition + tScrollAmount) \
into tScrollPosition
break
default
pass rawKeyDown
end switch
set the vScroll of the target to tScrollPosition
else
pass rawKeyDown
end if
end rawKeyDown

1 change: 1 addition & 0 deletions notes/bugfix-21484.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Allow scroll wheel to work in PI text fields