Skip to content

Commit 69ecfcd

Browse files
andrewkwwpaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent f062e50 commit 69ecfcd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

gitk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,8 +2503,7 @@ proc makewindow {} {
25032503
bind . <F5> updatecommits
25042504
bind . <Shift-F5> reloadcommits
25052505
bind . <F2> showrefs
2506-
bind . <Shift-F4> {newview 0}
2507-
catch { bind . <Shift-Key-XF86_Switch_VT_4> {newview 0} }
2506+
bindmodfunctionkey Shift 4 {newview 0}
25082507
bind . <F4> edit_or_newview
25092508
bind . <$M1B-q> doquit
25102509
bind . <$M1B-f> {dofind 1 1}
@@ -2653,6 +2652,11 @@ proc bindkey {ev script} {
26532652
}
26542653
}
26552654

2655+
proc bindmodfunctionkey {mod n script} {
2656+
bind . <$mod-F$n> $script
2657+
catch { bind . <$mod-XF86_Switch_VT_$n> $script }
2658+
}
2659+
26562660
# set the focus back to the toplevel for any click outside
26572661
# the entry widgets
26582662
proc click {w} {

0 commit comments

Comments
 (0)