From 69ecfcd6ebcc42c73be25b876c79ee09d5f2901d Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Tue, 2 Oct 2012 11:04:44 -0400 Subject: [PATCH] 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 --- gitk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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} { -- 2.11.4.GIT