Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit bab3b68

Browse files
author
Monte Goulding
authored
Merge pull request #1989 from bwmilby/bwm-bugfix-21484
[[ Bug 21484 ]] Allow scroll wheel to work in PI text fields
2 parents 3c68dfa + 0845a79 commit bab3b68

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Toolset/palettes/inspector/behaviors/revinspectoreditorbehavior.livecodescript

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,42 @@ getProp editorExpandVertical
303303
return sExpandVertical
304304
end editorExpandVertical
305305

306+
on rawKeyDown pKeyNum
307+
-- allow scroll wheel, pgup, & pgdn to scroll the text field
308+
-- bubble up to the parent if at either limit
309+
if the target contains "field" then
310+
local tScrollPosition, tScrollAmount, tScrollMax
311+
put the vScroll of the target into tScrollPosition
312+
put 0 into tScrollAmount
313+
switch pKeyNum
314+
case "65365"
315+
put 45 into tScrollAmount
316+
-- fall through
317+
case "65309"
318+
if tScrollPosition is 0 then pass rawKeyDown
319+
add 5 to tScrollAmount
320+
put max(0, tScrollPosition - tScrollAmount) into tScrollPosition
321+
break
322+
case "65366"
323+
put 45 into tScrollAmount
324+
-- fall through
325+
case "65308"
326+
add 5 to tScrollAmount
327+
put the formattedHeight of the target - \
328+
the height of the target into tScrollMax
329+
if tScrollPosition is tScrollMax then pass rawKeyDown
330+
put min(tScrollMax, tScrollPosition + tScrollAmount) \
331+
into tScrollPosition
332+
break
333+
default
334+
pass rawKeyDown
335+
end switch
336+
set the vScroll of the target to tScrollPosition
337+
else
338+
pass rawKeyDown
339+
end if
340+
end rawKeyDown
341+
306342
after openField
307343
select the text of the target
308344
end openField

notes/bugfix-21484.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Allow scroll wheel to work in PI text fields

0 commit comments

Comments
 (0)