Skip to content

Commit

Permalink
gitk: Refactor code for binding modified function keys
Browse files Browse the repository at this point in the history
The function includes a workaround for systems where F* keys are mapped
to XF86_Switch_VT_* when modifiers are used.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Andrew Wong authored and Paul Mackerras committed Oct 21, 2012
1 parent f062e50 commit 69ecfcd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -2503,8 +2503,7 @@ proc makewindow {} {
bind . <F5> updatecommits
bind . <Shift-F5> reloadcommits
bind . <F2> showrefs
bind . <Shift-F4> {newview 0}
catch { bind . <Shift-Key-XF86_Switch_VT_4> {newview 0} }
bindmodfunctionkey Shift 4 {newview 0}
bind . <F4> edit_or_newview
bind . <$M1B-q> doquit
bind . <$M1B-f> {dofind 1 1}
Expand Down Expand Up @@ -2653,6 +2652,11 @@ proc bindkey {ev script} {
}
}

proc bindmodfunctionkey {mod n script} {
bind . <$mod-F$n> $script
catch { bind . <$mod-XF86_Switch_VT_$n> $script }
}

# set the focus back to the toplevel for any click outside
# the entry widgets
proc click {w} {
Expand Down

0 comments on commit 69ecfcd

Please sign in to comment.