summaryrefslogtreecommitdiffstats
path: root/library/ttk
diff options
context:
space:
mode:
authorculler <culler>2020-04-15 17:42:15 (GMT)
committerculler <culler>2020-04-15 17:42:15 (GMT)
commit87b398bc1696bbcd7294aebf2f61dcd36b0e3e82 (patch)
treebe5e5df10749c257bb966c7140b08c62512392fc /library/ttk
parent1199fb12aa7e4ac580c3693185b4297f8d9e4df2 (diff)
parentef67d7e478dcdd96b095c80fbf1d95330ee35117 (diff)
downloadtk-87b398bc1696bbcd7294aebf2f61dcd36b0e3e82.zip
tk-87b398bc1696bbcd7294aebf2f61dcd36b0e3e82.tar.gz
tk-87b398bc1696bbcd7294aebf2f61dcd36b0e3e82.tar.bz2
Apply a patch from Christopher Chavez which correctly deals with the fact that Apple uses the middle mouse button for Button 3.
Diffstat (limited to 'library/ttk')
-rw-r--r--library/ttk/entry.tcl19
1 files changed, 13 insertions, 6 deletions
diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl
index b860ae6..4cdb5ac 100644
--- a/library/ttk/entry.tcl
+++ b/library/ttk/entry.tcl
@@ -82,13 +82,20 @@ bind TEntry <<ToggleSelection>> {
%W instate {!readonly !disabled} { %W icursor @%x ; focus %W }
}
-## Button2 bindings:
+## Button2 (Button3 on Aqua) bindings:
# Used for scanning and primary transfer.
-# Note: ButtonRelease-2 is mapped to <<PasteSelection>> in tk.tcl.
-#
-bind TEntry <Button-2> { ttk::entry::ScanMark %W %x }
-bind TEntry <B2-Motion> { ttk::entry::ScanDrag %W %x }
-bind TEntry <ButtonRelease-2> { ttk::entry::ScanRelease %W %x }
+# Note: ButtonRelease-2 (ButtonRelease-3 on Aqua)
+# is mapped to <<PasteSelection>> in tk.tcl.
+#
+if {[tk windowingsystem] ne "aqua"} {
+ bind TEntry <Button-2> { ttk::entry::ScanMark %W %x }
+ bind TEntry <B2-Motion> { ttk::entry::ScanDrag %W %x }
+ bind TEntry <ButtonRelease-2> { ttk::entry::ScanRelease %W %x }
+} else {
+ bind TEntry <Button-3> { ttk::entry::ScanMark %W %x }
+ bind TEntry <B3-Motion> { ttk::entry::ScanDrag %W %x }
+ bind TEntry <ButtonRelease-3> { ttk::entry::ScanRelease %W %x }
+}
bind TEntry <<PasteSelection>> { ttk::entry::ScanRelease %W %x }
## Keyboard navigation bindings: