summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorAndrew Wong <andrew.kw.w@gmail.com>2012-10-02 15:04:44 (GMT)
committerPaul Mackerras <paulus@samba.org>2012-10-21 22:16:31 (GMT)
commit69ecfcd6ebcc42c73be25b876c79ee09d5f2901d (patch)
tree162dc9216a392fc2c6bf042cd900a8bb40761486 /gitk
parentf062e50fe69e01376b6ebf7ade8402b782620ac3 (diff)
downloadgit-69ecfcd6ebcc42c73be25b876c79ee09d5f2901d.zip
git-69ecfcd6ebcc42c73be25b876c79ee09d5f2901d.tar.gz
git-69ecfcd6ebcc42c73be25b876c79ee09d5f2901d.tar.bz2
gitk: Refactor code for binding modified function keys
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>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk8
1 files changed, 6 insertions, 2 deletions
diff --git a/gitk b/gitk
index 379582a..f8f89a5 100755
--- a/gitk
+++ b/gitk
@@ -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}
@@ -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} {