diff options
Diffstat (limited to 'library/listbox.tcl')
-rw-r--r-- | library/listbox.tcl | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl index f0009bf..a27ae1e 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -175,18 +175,29 @@ bind Listbox <Button-2> { bind Listbox <B2-Motion> { %W scan dragto %x %y } - bind Listbox <MouseWheel> { - tk::MouseWheel %W y %D -40.0 + tk::MouseWheel %W y %D -40.0 units } bind Listbox <Option-MouseWheel> { - tk::MouseWheel %W y %D -12.0 + tk::MouseWheel %W y %D -12.0 units } bind Listbox <Shift-MouseWheel> { - tk::MouseWheel %W x %D -40.0 + tk::MouseWheel %W x %D -40.0 units } bind Listbox <Shift-Option-MouseWheel> { - tk::MouseWheel %W x %D -12.0 + tk::MouseWheel %W x %D -12.0 units +} +bind Listbox <TouchpadScroll> { + if {[expr {%# %% 15}] != 0} { + return + } + lassign [tk::PreciseScrollDeltas %D] deltaX deltaY + if {$deltaX != 0} { + %W xview scroll [expr {-$deltaX}] units + } + if {$deltaY != 0} { + %W yview scroll [expr {-$deltaY}] units + } } # ::tk::ListboxBeginSelect -- |