summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2023-11-27 15:31:55 (GMT)
committermarc_culler <marc.culler@gmail.com>2023-11-27 15:31:55 (GMT)
commitc60d0f8978d1ebd2ec490caa1464b450c70b9d9f (patch)
tree0621b90d234f438e570f1d01a1b33bff5ff1ed4a /library
parent86bb88b4cfed28625b8dfadb202c7f86d2531ec3 (diff)
downloadtk-c60d0f8978d1ebd2ec490caa1464b450c70b9d9f.zip
tk-c60d0f8978d1ebd2ec490caa1464b450c70b9d9f.tar.gz
tk-c60d0f8978d1ebd2ec490caa1464b450c70b9d9f.tar.bz2
Introduce a separate TouchpadScroll event. Avoids Extended-MouseWheel events being handled by MouseWheel bindings.
Diffstat (limited to 'library')
-rw-r--r--library/demos/cscroll.tcl3
-rw-r--r--library/demos/items.tcl3
-rw-r--r--library/listbox.tcl2
-rw-r--r--library/scrlbar.tcl2
-rw-r--r--library/text.tcl2
-rw-r--r--library/ttk/scrollbar.tcl2
6 files changed, 6 insertions, 8 deletions
diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl
index bb5e121..9b7f394 100644
--- a/library/demos/cscroll.tcl
+++ b/library/demos/cscroll.tcl
@@ -108,8 +108,7 @@ if {([tk windowingsystem] eq "aqua") && ![package vsatisfies [package provide Tk
%W xview scroll [expr {(%D-2)/-3}] units
}
}
- #Touchpad scrolling
- bind $c <Extended-MouseWheel> {
+ bind $c <TouchpadScroll> {
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
if {$deltaX != 0 || $deltaY != 0} {
tk::CanvasScrollByPixels %W $deltaX $deltaY
diff --git a/library/demos/items.tcl b/library/demos/items.tcl
index 90eb027..be07916 100644
--- a/library/demos/items.tcl
+++ b/library/demos/items.tcl
@@ -34,8 +34,7 @@ canvas $c -scrollregion {0c 0c 30c 24c} -width 15c -height 10c \
ttk::scrollbar $w.frame.vscroll -command "$c yview"
ttk::scrollbar $w.frame.hscroll -orient horizontal -command "$c xview"
-#Touchpad scrolling
-bind $c <Extended-MouseWheel> {
+bind $c <TouchpadScroll> {
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
if {$deltaX != 0 || $deltaY != 0} {
tk::CanvasScrollByPixels %W $deltaX $deltaY
diff --git a/library/listbox.tcl b/library/listbox.tcl
index c79be3a..32eea4b 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -187,7 +187,7 @@ bind Listbox <Shift-MouseWheel> {
bind Listbox <Shift-Option-MouseWheel> {
tk::MouseWheel %W x %D -12.0 units
}
-bind Listbox <Extended-MouseWheel> {
+bind Listbox <TouchpadScroll> {
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
if {$deltaX != 0} {
%W xview scroll [expr {-$deltaX}] units
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index 909d93d..5c4ba72 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -137,7 +137,7 @@ bind Scrollbar <MouseWheel> {
tk::ScrollByUnits %W hv %D -40.0
}
-bind Scrollbar <Extended-MouseWheel> {
+bind Scrollbar <TouchpadScroll> {
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
if {$deltaX != 0 && [%W cget -orient] eq "horizontal"} {
tk::ScrollbarScrollByPixels %W h $deltaX
diff --git a/library/text.tcl b/library/text.tcl
index 4e0476d..f2ef83a 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -456,7 +456,7 @@ bind Text <B2-Motion> {
}
set ::tk::Priv(prevPos) {}
-bind Text <Extended-MouseWheel> {
+bind Text <TouchpadScroll> {
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
if {$deltaX != 0} {
%W xview scroll [expr {-$deltaX}] pixels
diff --git a/library/ttk/scrollbar.tcl b/library/ttk/scrollbar.tcl
index 0fd4c6a..28c6a84 100644
--- a/library/ttk/scrollbar.tcl
+++ b/library/ttk/scrollbar.tcl
@@ -21,7 +21,7 @@ bind TScrollbar <ButtonRelease-2> { ttk::scrollbar::Release %W %x %y }
#
bind TScrollbar <MouseWheel> [bind Scrollbar <MouseWheel>]
bind TScrollbar <Option-MouseWheel> [bind Scrollbar <Option-MouseWheel>]
-bind TScrollbar <Extended-MouseWheel> [bind Scrollbar <Extended-MouseWheel>]
+bind TScrollbar <TouchpadScroll> [bind Scrollbar <TouchpadScroll>]
proc ttk::scrollbar::Scroll {w n units} {
set cmd [$w cget -command]