Thread (8 messages) flat view 8 messages, 4 authors, 2016-06-15
STALE3741d

[PATCH v2 1/2] gitk: Refactor code for binding modified function keys

From: Andrew Wong <hidden>
Date: 2016-06-15 22:54:55
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 gitk | 8 ++++++--
 1 file 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} {
-- 
1.7.12.1.382.gb0576a6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help