From: Andrew Wong Date: Tue, 2 Oct 2012 15:04:44 +0000 (-0400) Subject: gitk: Refactor code for binding modified function keys X-Git-Tag: v1.8.2-rc0~96^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69ecfcd6ebcc42c73be25b876c79ee09d5f2901d;p=thirdparty%2Fgit.git 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 Signed-off-by: Paul Mackerras --- diff --git a/gitk b/gitk index 379582a5f7..f8f89a5052 100755 --- a/gitk +++ b/gitk @@ -2503,8 +2503,7 @@ proc makewindow {} { bind . updatecommits bind . reloadcommits bind . showrefs - bind . {newview 0} - catch { bind . {newview 0} } + bindmodfunctionkey Shift 4 {newview 0} bind . 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} {