{"thread":{"id":"10266","subject":"[PATCH] gitk: Added support for OS X mouse wheel","startedAt":"2007-10-13T17:33:07Z","lastAt":"2007-10-13T17:33:07Z","messageCount":1,"participants":["Jonathan del Strother"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"55617","messageId":"193EA1A3-1BE3-42E4-8A47-0F025E0D3645@steelskies.com","threadId":"10266","inReplyTo":null,"subject":"[PATCH] gitk: Added support for OS X mouse wheel","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2007-10-13T17:33:07Z","receivedAt":"2007-10-13T17:33:07Z","isPatch":true,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"(Väinö Järvelä supplied this patch a while ago for 1.5.2.  It no longer\napplied cleanly, so I'm reposting it.)\n\nMacBook doesn't seem to recognize MouseRelease-4 and -5 events, at all.\nSo i added a support for the MouseWheel event, which i limited to Tcl/tk\naqua, as i couldn't test it neither on Linux or Windows. Tcl/tk needs to\nbe updated from the version that is shipped with OS X 10.4 Tiger, for\nthis patch to work.\n\nSigned-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>\n---\n  gitk |   14 ++++++++++----\n  1 files changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 300fdce..9b3e627 100755\n--- a/gitk\n+++ b/gitk\n@@ -838,11 +838,17 @@ proc makewindow {} {\n      bindall <1> {selcanvline %W %x %y}\n      #bindall <B1-Motion> {selcanvline %W %x %y}\n      if {[tk windowingsystem] == \"win32\"} {\n-\tbind . <MouseWheel> { windows_mousewheel_redirector %W %X %Y %D }\n-\tbind $ctext <MouseWheel> { windows_mousewheel_redirector %W %X %Y % \nD ; break }\n+        bind . <MouseWheel> { windows_mousewheel_redirector %W %X %Y  \n%D }\n+        bind $ctext <MouseWheel> { windows_mousewheel_redirector %W % \nX %Y %D ; break }\n      } else {\n-\tbindall <ButtonRelease-4> \"allcanvs yview scroll -5 units\"\n-\tbindall <ButtonRelease-5> \"allcanvs yview scroll 5 units\"\n+        bindall <ButtonRelease-4> \"allcanvs yview scroll -5 units\"\n+        bindall <ButtonRelease-5> \"allcanvs yview scroll 5 units\"\n+        if {[tk windowingsystem] eq \"aqua\"} {\n+            bindall <MouseWheel> {\n+                set delta [expr {- (%D)}]\n+                allcanvs yview scroll $delta units\n+            }\n+        }\n      }\n      bindall <2> \"canvscan mark %W %x %y\"\n      bindall <B2-Motion> \"canvscan dragto %W %x %y\"\n-- \n1.5.3.1\n"}]}