From 980ae6a23702e62f4ad7dbf74380ce857bac3360 Mon Sep 17 00:00:00 2001 From: RedBearAK <64876997+RedBearAK@users.noreply.github.com> Date: Mon, 29 Mar 2021 00:32:39 -0800 Subject: [PATCH 1/3] Mapping Cmd+Dot to Ctrl+C (terminals) and Escape (GUIs) --- linux/kinto.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/linux/kinto.py b/linux/kinto.py index 81a2fc4..5e68f72 100755 --- a/linux/kinto.py +++ b/linux/kinto.py @@ -247,10 +247,21 @@ define_keymap(re.compile(chromeStr, re.IGNORECASE),{ }) # Opera C-F12 +################################################################ +################################################################ +# THIS BLOCK IS TO BE REMOVED AFTER FIGURING OUT WHY GUI MAPPING +# IN NEXT BLOCK IS OVERRIDING TERMINAL MAPPING FOR SAME SHORTCUT +define_keymap(re.compile(termStr, re.IGNORECASE),{ + K("RC-Dot"): K("LC-c"), # Map Ctrl+Dot to Ctrl+C in terminals +}, "Mapping Ctrl+Dot to Ctrl+C in terminals") +################################################################ +################################################################ + # None referenced here originally # - but remote clients and VM software ought to be set here # These are the typical remaps for ALL GUI based apps define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{ + K("RC-Dot"): K("Esc"), # Mimic macOS Cmd+dot = Escape key (not in terminals) K("RC-Space"): K("Alt-F1"), # Default SL - Launch Application Menu (gnome/kde) K("RC-F3"):K("Super-d"), # Default SL - Show Desktop (gnome/kde,eos) K("RC-Super-f"):K("M-F10"), # Default SL - Maximize app (gnome/kde) @@ -535,7 +546,8 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{ K("RC-N"): K("C-Shift-N"), K("RC-M"): K("C-Shift-M"), K("RC-COMMA"): K("C-Shift-COMMA"), - K("RC-DOT"): K("C-Shift-DOT"), + # K("RC-DOT"): K("C-Shift-DOT"), + K("RC-Dot"): K("LC-c"), K("RC-SLASH"): K("C-Shift-SLASH"), K("RC-KPASTERISK"): K("C-Shift-KPASTERISK"), }, "terminals") From b532a9891d6dfa4ba0b8d328f4304ebd9e364796 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Wed, 31 Mar 2021 23:43:14 -0500 Subject: [PATCH 2/3] Updated remotes and terminals groupings for Linux. Adds Cmd-Dot sigint from #442 --- linux/kinto.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/linux/kinto.py b/linux/kinto.py index 5e68f72..0611087 100755 --- a/linux/kinto.py +++ b/linux/kinto.py @@ -22,7 +22,8 @@ remotes = [client.casefold() for client in remotes] # Add remote desktop clients & VMs for no remapping terminals.extend(remotes) -mscodes.extend(remotes) +remotes.extend(terminals) +remotes = list(set(remotes)) # Use for browser specific hotkeys browsers = ["Chromium","Chromium-browser","Google-chrome","microsoft-edge-dev","microsoft-edge","Epiphany","Firefox","Discord"] @@ -210,7 +211,7 @@ define_keymap(re.compile("^jetbrains-(?!.*toolbox).*$", re.IGNORECASE),{ # VCS/Local History K("Super-v"): K("M-Grave"), # VCS quick popup K("Super-c"): K("LC-c"), # Sigints - interrupt -}) +},"Jetbrains") # Keybindings for Nautilus define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{ @@ -218,7 +219,7 @@ define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{ K("RC-Down"): K("M-Down"), # Go Down dir K("RC-Left"): K("M-Left"), # Go Back K("RC-Right"): K("M-Right"), # Go Forward -}) +},"Nautilus - Finder") # Keybindings for Browsers define_keymap(re.compile(browserStr, re.IGNORECASE),{ @@ -244,19 +245,9 @@ define_keymap(re.compile("Firefox", re.IGNORECASE),{ }) define_keymap(re.compile(chromeStr, re.IGNORECASE),{ K("C-comma"): [K("M-e"), K("s"),K("Enter")], -}) +}, "Browsers") # Opera C-F12 -################################################################ -################################################################ -# THIS BLOCK IS TO BE REMOVED AFTER FIGURING OUT WHY GUI MAPPING -# IN NEXT BLOCK IS OVERRIDING TERMINAL MAPPING FOR SAME SHORTCUT -define_keymap(re.compile(termStr, re.IGNORECASE),{ - K("RC-Dot"): K("LC-c"), # Map Ctrl+Dot to Ctrl+C in terminals -}, "Mapping Ctrl+Dot to Ctrl+C in terminals") -################################################################ -################################################################ - # None referenced here originally # - but remote clients and VM software ought to be set here # These are the typical remaps for ALL GUI based apps @@ -337,7 +328,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in remotes,{ K("Alt-Delete"): K("C-Delete"), # Delete Right Word of Cursor # K(""): pass_through_key, # cancel # K(""): K(""), # -}) +}, "General GUI") define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{ # Wordwise remaining - for Everything but VS Code @@ -360,7 +351,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{ # https://superuser.com/questions/770301/pentadactyl-how-to-disable-menu-bar-toggle-by-alt # ** # -}) +}, "Wordwise - not vscode") # Keybindings for VS Code define_keymap(re.compile(codeStr, re.IGNORECASE),{ @@ -546,7 +537,6 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{ K("RC-N"): K("C-Shift-N"), K("RC-M"): K("C-Shift-M"), K("RC-COMMA"): K("C-Shift-COMMA"), - # K("RC-DOT"): K("C-Shift-DOT"), K("RC-Dot"): K("LC-c"), K("RC-SLASH"): K("C-Shift-SLASH"), K("RC-KPASTERISK"): K("C-Shift-KPASTERISK"), From d8ad4b874f2fd965b9506d69e94b6e87fae3a05f Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Thu, 1 Apr 2021 00:13:17 -0500 Subject: [PATCH 3/3] Added Cmd-Dot for Windows --- windows/kinto.ahk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/windows/kinto.ahk b/windows/kinto.ahk index 97a8e93..a38561f 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -131,6 +131,7 @@ Exit() { SetTitleMatchMode, 2 GroupAdd, terminals, ahk_exe ubuntu.exe +GroupAdd, terminals, ahk_exe ubuntu2004.exe GroupAdd, terminals, ahk_exe ConEmu.exe GroupAdd, terminals, ahk_exe ConEmu64.exe GroupAdd, terminals, ahk_exe powershell.exe @@ -144,6 +145,7 @@ GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow GroupAdd, terminals, ahk_class Console_2_Main GroupAdd, posix, ahk_exe ubuntu.exe +GroupAdd, posix, ahk_exe ubuntu2004.exe GroupAdd, posix, ahk_exe ConEmu.exe GroupAdd, posix, ahk_exe ConEmu64.exe GroupAdd, posix, ahk_exe Hyper.exe @@ -411,6 +413,7 @@ GroupAdd, intellij, ahk_exe idea64.exe ; #If ; Chromebook #IfWinNotActive ahk_group terminals + ^.::Send {Esc} ; emacs style #n::Send {Down} #p::Send {Up} @@ -672,6 +675,7 @@ GroupAdd, intellij, ahk_exe idea64.exe ; Sigints - interrupt ; $#c::Send {Ctrl down}c{Ctrl up} ; Default ; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM + $^.::Send {Ctrl down}c{Ctrl up} ; Windows Terminal ; Ctrl+Shift+C should do nothing