git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Andrew Wong <andrew.kw.w@gmail.com>
Date
Oct 2, 2012, 15:04 UTC
Message-ID
<1349190285-7788-2-git-send-email-andrew.kw.w@gmail.com>
In-Reply-To
<1349190285-7788-1-git-send-email-andrew.kw.w@gmail.com>

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>
---
 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
Previous: Andrew WongNext: Andrew Wong
Message 6 of 11 in “gitk: can't reload commits with new key binding”
  1. SZEDER GáborSep 30, 2012
  2. Andrew WongOct 1, 2012
  3. gitk: Add workaround for system where Shift-F5 mapped to Shift-XF86_Switch_VT_5Andrew Wong, Oct 1, 2012
  4. Junio C HamanoOct 1, 2012
  5. 0/2 Re: gitk: can't reload commits with new key bindingAndrew Wong, Oct 2, 2012
  6. 1/2 gitk: Refactor code for binding modified function keysAndrew Wong, Oct 2, 2012
  7. 2/2 gitk: Use bindshiftfunctionkey to bind Shift-F5Andrew Wong, Oct 2, 2012
  8. Andrew WongOct 7, 2012
  9. SZEDER GáborOct 8, 2012
  10. Andrew WongOct 12, 2012
  11. Paul MackerrasOct 21, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.