git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] gitk: Added support for OS X mouse wheel

From
Jonathan del Strother <maillist@steelskies.com>
Date
Oct 15, 2007, 09:33 UTC
Message-ID
<1192440788347-git-send-email-maillist@steelskies.com>
In-Reply-To
<8c5c35580710141727k4bbd2bgc2292cfcc6f97c4a@mail.gmail.com>
From: Jonathan del Strother <jon.delStrother@bestbefore.tv>

(Väinö Järvelä supplied this patch a while ago for 1.5.2. It no longer applied cleanly, so I'm reposting it.)

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: Jonathan del Strother <jon.delStrother@bestbefore.tv>
---
 gitk |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index 300fdce..ee2a6f5 100755
--- a/gitk
+++ b/gitk
@@ -843,6 +843,12 @@ proc makewindow {} {
     } else {
 	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"
-- 
1.5.3.1
Previous: Jonathan del StrotherNext: Jonathan del Strother
Message 2 of 3 in “gitk: Added support for OS X mouse wheel”
  1. 0/2 gitk: Added support for OS X mouse wheelJonathan del Strother, Oct 15, 2007
  2. 1/2 gitk: Added support for OS X mouse wheelJonathan del Strother, Oct 15, 2007
  3. 2/2 Fixing gitk indentationJonathan del Strother, Oct 15, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.