git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan del Strother <maillist@steelskies.com>
To: git@vger.kernel.org
Cc: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Subject: [PATCH 1/2] gitk: Added support for OS X mouse wheel
Date: Mon, 15 Oct 2007 10:33:07 +0100	[thread overview]
Message-ID: <1192440788347-git-send-email-maillist@steelskies.com> (raw)
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

  parent reply	other threads:[~2007-10-15  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8c5c35580710141727k4bbd2bgc2292cfcc6f97c4a@mail.gmail.com>
2007-10-15  9:33 ` [PATCH 0/2] gitk: Added support for OS X mouse wheel Jonathan del Strother
2007-10-15  9:33 ` Jonathan del Strother [this message]
2007-10-15  9:33 ` [PATCH 2/2] Fixing gitk indentation Jonathan del Strother

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1192440788347-git-send-email-maillist@steelskies.com \
    --to=maillist@steelskies.com \
    --cc=git@vger.kernel.org \
    --cc=jon.delStrother@bestbefore.tv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).