Skip to content

Commit

Permalink
gitk: Add support for OS X mouse wheel
Browse files Browse the repository at this point in the history
(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>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Jonathan del Strother authored and Shawn O. Pearce committed Oct 20, 2007
1 parent 0166419 commit 5dd57d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5dd57d5

Please sign in to comment.