threads / patch / 9283

patchgitk: Added support for OS X mouse wheel

Subject: [PATCH] gitk: Added support for OS X mouse wheel

## tl;dr

One message between Jul 29, 2007 and Jul 29, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Väinö Järvelä· Jul 29, 2007, 06:38 UTC · lore

MacBook doesn't seem to recognize MouseRelease-4 and -5 events, at all. So i added a support for the MouseWheel event, which i limited to Tcl/tk aqua, as i couldn't test it neither on Linux or Windows. Tcl/tk needs to be updated from the version that is shipped with OS X 10.4 Tiger, for this patch to work.

Signed-off-by: Väinö Järvelä <v@pp.inet.fi>
---
gitk |    6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
Show changes to gitk +6 −1
diff --git a/gitk b/gitk
index f74ce51..985c30a 100755
--- a/gitk
+++ b/gitk
@@ -825,6 +825,12 @@ proc makewindow {} {
      #bindall <B1-Motion> {selcanvline %W %x %y}
      bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
      bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
+    if {[tk windowingsystem] eq "aqua"} {
+        bindall <MouseWheel> {
+                set delta [expr {- (%D)}]
+                allcanvs yview scroll $delta units
+        }
+    }
      bindall <2> "canvscan mark %W %x %y"
      bindall <B2-Motion> "canvscan dragto %W %x %y"
      bindkey <Home> selfirstline
--
1.5.2

← back to recent threads