this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Lots more windows updates

- Check in default.ahk2 for macOS-like bindings
- Give a bunch of yadm alts extensions, which works better on Windows
- Use scoop for windows terminal prefs
- yadm / forkgit fixes to play nice with WSL/Cygwin
- Delete Windows kinto files that I'm no longer using

+664 -1602
+5 -3
.bashrc
··· 64 64 65 65 export PATH="/usr/local/opt/node@8/bin:$PATH" 66 66 67 - # grep colors 68 - export GREP_OPTIONS="--color=auto" 67 + # Explicit XDG dirs for Windows (i.e. gitbash) 68 + export XDG_CONFIG_HOME="$HOME/.config" 69 + export XDG_DATA_HOME="$HOME/.local/share" 70 + export XDG_STATE_HOME="$HOME/.local/state" 69 71 70 72 # `history` timestamp in output 71 73 export HISTTIMEFORMAT="%F %T " ··· 105 107 106 108 export PYENV_VIRTUALENV_DISABLE_PROMPT=1 107 109 108 - if which pyenv &>/dev/null; then 110 + if which pyenv &>/dev/null && [[ "$(uname -o)" != Msys ]]; then 109 111 eval "$(pyenv init -)" 110 112 eval "$(pyenv virtualenv-init -)" 111 113 fi
+3
.bashrc.aliases
··· 115 115 116 116 alias vim="vim -p" 117 117 118 + # grep colors 119 + alias grep="grep --color=auto" 120 + 118 121 function tbm_ssh() { 119 122 if [ "$MAC_OS" = true ]; then 120 123 local dev_host=$(basename $(gbase))
+16 -1
.config/nvim/init.lua
··· 1 - HOME = os.getenv("HOME") or os.getenv("LocalAppData") 1 + HOME = os.getenv("HOME") or os.getenv("USERPROFILE") or os.getenv("LocalAppData") 2 2 3 3 local sep = package.config:sub(1, 1) 4 4 ··· 81 81 82 82 vim.api.nvim_feedkeys("r", "n", true) 83 83 end) 84 + 85 + -- Fix comment handling for AHK 86 + vim.api.nvim_create_autocmd({ "BufEnter" }, { 87 + pattern = {"*.ahk", "*.ahk2"}, 88 + group = group, 89 + callback = function(args) 90 + vim.opt.comments = { 91 + "s1:/*", 92 + "mb:*", 93 + "ex:*/", 94 + ":;;", 95 + ":;", 96 + } 97 + end 98 + }) 84 99 85 100 -- For whatever reason, nvim buffers sometimes open without line numbers: 86 101 vim.opt.number = true
-370
.config/yadm/alt/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json##os.Msys,extension.json
··· 1 - { 2 - "$help": "https://aka.ms/terminal-documentation", 3 - "$schema": "https://aka.ms/terminal-profiles-schema", 4 - "actions": 5 - [ 6 - { 7 - "command": "unbound", 8 - "keys": "ctrl+w" 9 - }, 10 - { 11 - "command": 12 - { 13 - "action": "copy", 14 - "singleLine": false 15 - }, 16 - "keys": "ctrl+c" 17 - }, 18 - { 19 - "command": "paste", 20 - "keys": "ctrl+v" 21 - }, 22 - { 23 - "command": 24 - { 25 - "action": "splitPane", 26 - "split": "auto", 27 - "splitMode": "duplicate" 28 - }, 29 - "keys": "alt+shift+d" 30 - }, 31 - { 32 - "command": "find", 33 - "keys": "ctrl+shift+f" 34 - }, 35 - { 36 - "command": 37 - { 38 - "action": "closeTab" 39 - }, 40 - "keys": "alt+w" 41 - } 42 - ], 43 - "copyFormatting": "none", 44 - "copyOnSelect": true, 45 - "defaultProfile": "{c397f356-5e7b-55bc-956b-8cb4b9762c26}", 46 - "newTabMenu": 47 - [ 48 - { 49 - "type": "remainingProfiles" 50 - } 51 - ], 52 - "profiles": 53 - { 54 - "defaults": 55 - { 56 - "bellSound": 57 - [ 58 - "C:\\Windows\\Media\\Windows Ding.wav" 59 - ], 60 - "bellStyle": 61 - [ 62 - "audible", 63 - "taskbar" 64 - ], 65 - "colorScheme": "Campbell", 66 - "cursorShape": "filledBox", 67 - "experimental.rightClickContextMenu": true, 68 - "font": 69 - { 70 - "face": "MonaspiceAr Nerd Font Mono", 71 - "size": 10.0, 72 - "weight": "semi-light" 73 - }, 74 - "intenseTextStyle": "bold", 75 - "opacity": 80, 76 - "startingDirectory": null, 77 - "useAcrylic": true 78 - }, 79 - "list": 80 - [ 81 - { 82 - "colorScheme": "Campbell Powershell", 83 - "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", 84 - "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", 85 - "hidden": false, 86 - "name": "Windows PowerShell" 87 - }, 88 - { 89 - "commandline": "%SystemRoot%\\System32\\cmd.exe", 90 - "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", 91 - "hidden": false, 92 - "name": "Command Prompt" 93 - }, 94 - { 95 - "guid": "{c397f356-5e7b-55bc-956b-8cb4b9762c26}", 96 - "hidden": false, 97 - "name": "NixOS", 98 - "source": "Windows.Terminal.Wsl", 99 - "startingDirectory": "~" 100 - }, 101 - { 102 - "altGrAliasing": true, 103 - "antialiasingMode": "grayscale", 104 - "closeOnExit": "automatic", 105 - "colorScheme": "Campbell Powershell", 106 - "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", 107 - "elevate": true, 108 - "guid": "{0fb33c24-b201-4274-b08f-dca05abc4d8d}", 109 - "hidden": false, 110 - "historySize": 9001, 111 - "icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png", 112 - "name": "Windows PowerShell (Admin)", 113 - "padding": "8, 8, 8, 8", 114 - "snapOnInput": true, 115 - "startingDirectory": "%USERPROFILE%" 116 - }, 117 - { 118 - "altGrAliasing": true, 119 - "antialiasingMode": "grayscale", 120 - "closeOnExit": "automatic", 121 - "colorScheme": 122 - { 123 - "light": "Campbell" 124 - }, 125 - "commandline": "C:\\Program Files\\Git\\bin\\bash.exe", 126 - "guid": "{76879a03-9117-4f36-8662-f5859711629b}", 127 - "hidden": false, 128 - "historySize": 9001, 129 - "name": "Git Bash", 130 - "padding": "8, 8, 8, 8", 131 - "snapOnInput": true, 132 - "startingDirectory": "%USERPROFILE%" 133 - } 134 - ] 135 - }, 136 - "schemes": 137 - [ 138 - { 139 - "background": "#0C0C0C", 140 - "black": "#0C0C0C", 141 - "blue": "#0037DA", 142 - "brightBlack": "#767676", 143 - "brightBlue": "#3B78FF", 144 - "brightCyan": "#61D6D6", 145 - "brightGreen": "#16C60C", 146 - "brightPurple": "#B4009E", 147 - "brightRed": "#E74856", 148 - "brightWhite": "#F2F2F2", 149 - "brightYellow": "#F9F1A5", 150 - "cursorColor": "#FFFFFF", 151 - "cyan": "#3A96DD", 152 - "foreground": "#CCCCCC", 153 - "green": "#13A10E", 154 - "name": "Campbell", 155 - "purple": "#881798", 156 - "red": "#C50F1F", 157 - "selectionBackground": "#FFFFFF", 158 - "white": "#CCCCCC", 159 - "yellow": "#C19C00" 160 - }, 161 - { 162 - "background": "#012456", 163 - "black": "#0C0C0C", 164 - "blue": "#0037DA", 165 - "brightBlack": "#767676", 166 - "brightBlue": "#3B78FF", 167 - "brightCyan": "#61D6D6", 168 - "brightGreen": "#16C60C", 169 - "brightPurple": "#B4009E", 170 - "brightRed": "#E74856", 171 - "brightWhite": "#F2F2F2", 172 - "brightYellow": "#F9F1A5", 173 - "cursorColor": "#FFFFFF", 174 - "cyan": "#3A96DD", 175 - "foreground": "#CCCCCC", 176 - "green": "#13A10E", 177 - "name": "Campbell Powershell", 178 - "purple": "#881798", 179 - "red": "#C50F1F", 180 - "selectionBackground": "#FFFFFF", 181 - "white": "#CCCCCC", 182 - "yellow": "#C19C00" 183 - }, 184 - { 185 - "background": "#282C34", 186 - "black": "#282C34", 187 - "blue": "#61AFEF", 188 - "brightBlack": "#5A6374", 189 - "brightBlue": "#61AFEF", 190 - "brightCyan": "#56B6C2", 191 - "brightGreen": "#98C379", 192 - "brightPurple": "#C678DD", 193 - "brightRed": "#E06C75", 194 - "brightWhite": "#DCDFE4", 195 - "brightYellow": "#E5C07B", 196 - "cursorColor": "#FFFFFF", 197 - "cyan": "#56B6C2", 198 - "foreground": "#DCDFE4", 199 - "green": "#98C379", 200 - "name": "One Half Dark", 201 - "purple": "#C678DD", 202 - "red": "#E06C75", 203 - "selectionBackground": "#FFFFFF", 204 - "white": "#DCDFE4", 205 - "yellow": "#E5C07B" 206 - }, 207 - { 208 - "background": "#FAFAFA", 209 - "black": "#383A42", 210 - "blue": "#0184BC", 211 - "brightBlack": "#4F525D", 212 - "brightBlue": "#61AFEF", 213 - "brightCyan": "#56B5C1", 214 - "brightGreen": "#98C379", 215 - "brightPurple": "#C577DD", 216 - "brightRed": "#DF6C75", 217 - "brightWhite": "#FFFFFF", 218 - "brightYellow": "#E4C07A", 219 - "cursorColor": "#4F525D", 220 - "cyan": "#0997B3", 221 - "foreground": "#383A42", 222 - "green": "#50A14F", 223 - "name": "One Half Light", 224 - "purple": "#A626A4", 225 - "red": "#E45649", 226 - "selectionBackground": "#4F525D", 227 - "white": "#FAFAFA", 228 - "yellow": "#C18301" 229 - }, 230 - { 231 - "background": "#002B36", 232 - "black": "#002B36", 233 - "blue": "#268BD2", 234 - "brightBlack": "#073642", 235 - "brightBlue": "#839496", 236 - "brightCyan": "#93A1A1", 237 - "brightGreen": "#586E75", 238 - "brightPurple": "#6C71C4", 239 - "brightRed": "#CB4B16", 240 - "brightWhite": "#FDF6E3", 241 - "brightYellow": "#657B83", 242 - "cursorColor": "#FFFFFF", 243 - "cyan": "#2AA198", 244 - "foreground": "#839496", 245 - "green": "#859900", 246 - "name": "Solarized Dark", 247 - "purple": "#D33682", 248 - "red": "#DC322F", 249 - "selectionBackground": "#FFFFFF", 250 - "white": "#EEE8D5", 251 - "yellow": "#B58900" 252 - }, 253 - { 254 - "background": "#FDF6E3", 255 - "black": "#002B36", 256 - "blue": "#268BD2", 257 - "brightBlack": "#073642", 258 - "brightBlue": "#839496", 259 - "brightCyan": "#93A1A1", 260 - "brightGreen": "#586E75", 261 - "brightPurple": "#6C71C4", 262 - "brightRed": "#CB4B16", 263 - "brightWhite": "#FDF6E3", 264 - "brightYellow": "#657B83", 265 - "cursorColor": "#002B36", 266 - "cyan": "#2AA198", 267 - "foreground": "#657B83", 268 - "green": "#859900", 269 - "name": "Solarized Light", 270 - "purple": "#D33682", 271 - "red": "#DC322F", 272 - "selectionBackground": "#073642", 273 - "white": "#EEE8D5", 274 - "yellow": "#B58900" 275 - }, 276 - { 277 - "background": "#000000", 278 - "black": "#000000", 279 - "blue": "#3465A4", 280 - "brightBlack": "#555753", 281 - "brightBlue": "#729FCF", 282 - "brightCyan": "#34E2E2", 283 - "brightGreen": "#8AE234", 284 - "brightPurple": "#AD7FA8", 285 - "brightRed": "#EF2929", 286 - "brightWhite": "#EEEEEC", 287 - "brightYellow": "#FCE94F", 288 - "cursorColor": "#FFFFFF", 289 - "cyan": "#06989A", 290 - "foreground": "#D3D7CF", 291 - "green": "#4E9A06", 292 - "name": "Tango Dark", 293 - "purple": "#75507B", 294 - "red": "#CC0000", 295 - "selectionBackground": "#FFFFFF", 296 - "white": "#D3D7CF", 297 - "yellow": "#C4A000" 298 - }, 299 - { 300 - "background": "#FFFFFF", 301 - "black": "#000000", 302 - "blue": "#3465A4", 303 - "brightBlack": "#555753", 304 - "brightBlue": "#729FCF", 305 - "brightCyan": "#34E2E2", 306 - "brightGreen": "#8AE234", 307 - "brightPurple": "#AD7FA8", 308 - "brightRed": "#EF2929", 309 - "brightWhite": "#EEEEEC", 310 - "brightYellow": "#FCE94F", 311 - "cursorColor": "#000000", 312 - "cyan": "#06989A", 313 - "foreground": "#555753", 314 - "green": "#4E9A06", 315 - "name": "Tango Light", 316 - "purple": "#75507B", 317 - "red": "#CC0000", 318 - "selectionBackground": "#555753", 319 - "white": "#D3D7CF", 320 - "yellow": "#C4A000" 321 - }, 322 - { 323 - "background": "#300A24", 324 - "black": "#171421", 325 - "blue": "#0037DA", 326 - "brightBlack": "#767676", 327 - "brightBlue": "#08458F", 328 - "brightCyan": "#2C9FB3", 329 - "brightGreen": "#26A269", 330 - "brightPurple": "#A347BA", 331 - "brightRed": "#C01C28", 332 - "brightWhite": "#F2F2F2", 333 - "brightYellow": "#A2734C", 334 - "cursorColor": "#FFFFFF", 335 - "cyan": "#3A96DD", 336 - "foreground": "#FFFFFF", 337 - "green": "#26A269", 338 - "name": "Ubuntu-ColorScheme", 339 - "purple": "#881798", 340 - "red": "#C21A23", 341 - "selectionBackground": "#FFFFFF", 342 - "white": "#CCCCCC", 343 - "yellow": "#A2734C" 344 - }, 345 - { 346 - "background": "#000000", 347 - "black": "#000000", 348 - "blue": "#000080", 349 - "brightBlack": "#808080", 350 - "brightBlue": "#0000FF", 351 - "brightCyan": "#00FFFF", 352 - "brightGreen": "#00FF00", 353 - "brightPurple": "#FF00FF", 354 - "brightRed": "#FF0000", 355 - "brightWhite": "#FFFFFF", 356 - "brightYellow": "#FFFF00", 357 - "cursorColor": "#FFFFFF", 358 - "cyan": "#008080", 359 - "foreground": "#C0C0C0", 360 - "green": "#008000", 361 - "name": "Vintage", 362 - "purple": "#800080", 363 - "red": "#800000", 364 - "selectionBackground": "#FFFFFF", 365 - "white": "#C0C0C0", 366 - "yellow": "#808000" 367 - } 368 - ], 369 - "themes": [] 370 - }
.config/yadm/alt/AppData/Roaming/Code/User/snippets/cpp.json##os.Msys .config/yadm/alt/AppData/Roaming/Code/User/snippets/cpp.json##os.Msys,e.json
.config/yadm/alt/AppData/Roaming/Code/User/snippets/file##os.Msys .config/yadm/alt/AppData/Roaming/Code/User/snippets/file##os.Msys,e.file
.config/yadm/alt/AppData/Roaming/Code/User/snippets/go.json##os.Msys .config/yadm/alt/AppData/Roaming/Code/User/snippets/go.json##os.Msys,e.json
.config/yadm/alt/AppData/Roaming/Code/User/snippets/markdown.json##os.Msys .config/yadm/alt/AppData/Roaming/Code/User/snippets/markdown.json##os.Msys,e.json
.config/yadm/alt/AppData/Roaming/Code/User/snippets/python.json##os.Msys .config/yadm/alt/AppData/Roaming/Code/User/snippets/python.json##os.Msys,e.json
.config/yadm/alt/AppData/Roaming/Code/User/snippets/rust.json##os.Msys .config/yadm/alt/AppData/Roaming/Code/User/snippets/rust.json##os.Msys,e.json
.config/yadm/alt/AppData/Roaming/Code/User/snippets/snippets.code-snippets##os.Msys .config/yadm/alt/AppData/Roaming/Code/User/snippets/snippets.code-snippets##os.Msys,e.code-snippets
.config/yadm/alt/AppData/Roaming/Code/User/snippets/starlark.json##os.Msys .config/yadm/alt/AppData/Roaming/Code/User/snippets/starlark.json##os.Msys,e.json
+1
.config/yadm/alt/AppData/Roaming/Stretchly/config.json##os.Msys,e.json
··· 1 + ../../../Library/Application Support/Stretchly/config.json##os.Darwin
+190
.config/yadm/alt/scoop/apps/windows-terminal/current/settings/settings.json##os.Msys,e.json
··· 1 + { 2 + "$help": "https://aka.ms/terminal-documentation", 3 + "$schema": "https://aka.ms/terminal-profiles-schema", 4 + "actions": 5 + [ 6 + { 7 + "command": 8 + { 9 + "action": "copy", 10 + "singleLine": false 11 + }, 12 + "id": "User.copy.644BA8F2", 13 + "keys": "ctrl+c" 14 + }, 15 + { 16 + "command": "paste", 17 + "id": "User.paste", 18 + "keys": "ctrl+v" 19 + }, 20 + { 21 + "command": "find", 22 + "id": "User.find", 23 + "keys": "ctrl+shift+f" 24 + }, 25 + { 26 + "command": 27 + { 28 + "action": "splitPane", 29 + "split": "auto", 30 + "splitMode": "duplicate" 31 + }, 32 + "id": "User.splitPane.A6751878", 33 + "keys": "alt+shift+d" 34 + }, 35 + { 36 + "command": 37 + { 38 + "action": "splitPane", 39 + "split": "right" 40 + }, 41 + "id": "User.splitPane.864CD510" 42 + }, 43 + { 44 + "command": 45 + { 46 + "action": "splitPane" 47 + }, 48 + "id": "User.splitPane.91AB55B1" 49 + }, 50 + { 51 + "command": 52 + { 53 + "action": "splitPane", 54 + "split": "right", 55 + "splitMode": "duplicate" 56 + }, 57 + "keys": "ctrl+\\" 58 + }, 59 + { 60 + "command": 61 + { 62 + "action": "splitPane", 63 + "split": "down" 64 + }, 65 + "id": "User.splitPane.D5151347" 66 + }, 67 + { 68 + "command": "unbound", 69 + "keys": "alt+shift+plus" 70 + }, 71 + { 72 + "command": "unbound", 73 + "keys": "alt+shift+minus" 74 + }, 75 + { 76 + "command": 77 + { 78 + "action": "splitPane", 79 + "split": "down", 80 + "splitMode": "duplicate" 81 + }, 82 + "keys": "ctrl+shift+\\" 83 + } 84 + ], 85 + "copyFormatting": "none", 86 + "copyOnSelect": true, 87 + "defaultProfile": "{c397f356-5e7b-55bc-956b-8cb4b9762c26}", 88 + "newTabMenu": 89 + [ 90 + { 91 + "commandline": null, 92 + "name": null, 93 + "source": "Windows.Terminal.Wsl", 94 + "type": "matchProfiles" 95 + }, 96 + { 97 + "commandline": "C:\\WINDOWS\\system32\\wsl.exe -d NixOS bash", 98 + "name": null, 99 + "source": null, 100 + "type": "matchProfiles" 101 + }, 102 + { 103 + "type": "separator" 104 + }, 105 + { 106 + "commandline": null, 107 + "name": null, 108 + "source": "Git", 109 + "type": "matchProfiles" 110 + }, 111 + { 112 + "type": "separator" 113 + }, 114 + { 115 + "type": "remainingProfiles" 116 + } 117 + ], 118 + "profiles": 119 + { 120 + "defaults": 121 + { 122 + "bellStyle": 123 + [ 124 + "audible", 125 + "taskbar" 126 + ], 127 + "cursorShape": "filledBox", 128 + "font": 129 + { 130 + "face": "Monaspace Argon Var, MonaspiceAr Nerd Font", 131 + "size": 10 132 + }, 133 + "intenseTextStyle": "all", 134 + "scrollbarState": "visible", 135 + "padding": "4, 4, -12, 4", 136 + "useAcrylic": true 137 + }, 138 + "list": 139 + [ 140 + { 141 + "guid": "{c397f356-5e7b-55bc-956b-8cb4b9762c26}", 142 + "hidden": false, 143 + "name": "NixOS", 144 + "source": "Windows.Terminal.Wsl" 145 + }, 146 + { 147 + "colorScheme": "Campbell", 148 + "commandline": "C:\\WINDOWS\\system32\\wsl.exe -d NixOS bash", 149 + "guid": "{616556db-a343-4d91-8c98-ea69d9b13b98}", 150 + "hidden": false, 151 + "icon": "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", 152 + "name": "NixOS (bash)", 153 + "startingDirectory": "~" 154 + }, 155 + { 156 + "guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}", 157 + "hidden": false, 158 + "name": "Git Bash", 159 + "source": "Git" 160 + }, 161 + { 162 + "colorScheme": "Campbell Powershell", 163 + "commandline": "%USERPROFILE%\\scoop\\shims\\pwsh.exe", 164 + "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", 165 + "hidden": false, 166 + "name": "PowerShell" 167 + }, 168 + { 169 + "altGrAliasing": true, 170 + "colorScheme": "Campbell Powershell", 171 + "commandline": "%USERPROFILE%\\scoop\\shims\\pwsh.exe", 172 + "elevate": true, 173 + "guid": "{8593d941-492c-4513-81a0-de8776418c01}", 174 + "hidden": false, 175 + "icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png", 176 + "name": "PowerShell (Admin)", 177 + "startingDirectory": "%USERPROFILE%" 178 + }, 179 + { 180 + "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", 181 + "hidden": false, 182 + "name": "Command Prompt" 183 + } 184 + ] 185 + }, 186 + "schemes": [], 187 + "tabSwitcherMode": "disabled", 188 + "themes": [], 189 + "useAcrylicInTabRow": true 190 + }
-7
.kinto/kinto-start.vbs
··· 1 - Set oShell = CreateObject("Shell.Application") 2 - Set wShell = WScript.CreateObject("WScript.Shell") 3 - Set fso = CreateObject("Scripting.FileSystemObject") 4 - 5 - path = wShell.ExpandEnvironmentStrings("""%userprofile%") 6 - strFolder = fso.BuildPath( path, "\.kinto\kinto.ahk"" win") 7 - oShell.ShellExecute "C:\Program Files\AutoHotkey\AutoHotkey.exe", strFolder, , , 0
-1221
.kinto/kinto.ahk
··· 1 - #SingleInstance force 2 - #NoEnv 3 - #Persistent 4 - 5 - ; DetectHiddenWindows, On ; Autodetect 6 - ; Run, %A_ScriptDir%\detectUSB.ahk ; Autodetect 7 - 8 - ; Enable Left clicks on Kinto Icon 9 - ; https://www.autohotkey.com/boards/viewtopic.php?t=9501 10 - OnMessage(0x404, "AHK_NOTIFYICON") 11 - 12 - AHK_NOTIFYICON(wParam, lParam) 13 - { 14 - if (lParam = 0x202) { ; user left-clicked tray icon 15 - ;ADD ANY SUBROUTINE OR FUNCTION HERE 16 - Menu, Tray, Show 17 - return 18 - } 19 - else if (lParam = 0x203) { ; user double left-clicked tray icon 20 - ;ADD ANY SUBROUTINE OR FUNCTION HERE 21 - Menu, Tray, Show 22 - return 23 - } 24 - } 25 - ; End Enable Left clicks 26 - 27 - ; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; MacModifiers 28 - ; IfExist, %I_Icon% ; MacModifiers 29 - ; Menu, Tray, Icon, %I_Icon%,, 1 ; MacModifiers 30 - ; Menu, Tray, Tip, Mac - Kinto ; MacModifiers 31 - 32 - I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; WinModifiers/CB/IBM 33 - IfExist, %I_Icon% ; WinModifiers/CB/IBM 34 - Menu, Tray, Icon, %I_Icon%,, 1 ; WinModifiers/CB/IBM 35 - Menu, Tray, Tip, Windows - Kinto ; WinModifiers 36 - ; Menu, Tray, Tip, Chromebook - Kinto ; Chromebook 37 - ; Menu, Tray, Tip, IBM - Kinto ; IBM 38 - 39 - Menu, Keyboards, Add, Windows, winkb 40 - Menu, Keyboards, Add, Apple, mackb 41 - Menu, Keyboards, Add, Chromebook, chromekb 42 - Menu, Keyboards, Add, IBM (No Super/Win key), ibmkb 43 - 44 - paramkb=%1% 45 - 46 - if paramkb = mac 47 - checkKB = Apple 48 - if paramkb = win 49 - checkKB = Windows 50 - if paramkb = chrome 51 - checkKB = Chromebook 52 - if paramkb = ibm 53 - checkKB = IBM (No Super/Win key) 54 - 55 - menu, Keyboards, check, %checkKB% 56 - 57 - ; Set Tray menu 58 - ; Menu, Tray, Standard 59 - Menu, Tray, NoStandard ; to remove default menu 60 - Menu, Tray, Add, Keyboard Types, :Keyboards 61 - Menu, Tray, Add, Autodetect Keyboards, autodetect 62 - ; Menu, Tray, check, Autodetect Keyboards ; Autodetect 63 - ; Menu, Tray, disable, Autodetect Keyboards ; CB/IBM 64 - Menu, Tray, Add, Suspend Kinto, tray_suspend 65 - ; Add tray menu item for toggling Option key special character entry scheme 66 - Menu, Tray, Add, OptSpecialChars Shift+Opt+Cmd+O, toggle_optspecialchars 67 - ; Menu, Tray, Add, Returns to Desktop, min 68 - Menu, Tray, Add 69 - Menu, Tray, Add, Close, Exit 70 - Menu, Tray, Click, 1 71 - 72 - winkb(){ 73 - Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" win, "%A_ScriptDir%" 74 - } 75 - 76 - mackb(){ 77 - Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" mac, "%A_ScriptDir%" 78 - } 79 - 80 - chromekb(){ 81 - Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" chrome, "%A_ScriptDir%" 82 - } 83 - 84 - ibmkb(){ 85 - Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" ibm, "%A_ScriptDir%" 86 - } 87 - 88 - autodetect(){ 89 - IfWinExist, detectUSB.ahk 90 - WinClose 91 - Run, "%A_ScriptDir%\NoShell.vbs" "%A_ScriptDir%\toggle_kb.bat" auto, "%A_ScriptDir%" 92 - } 93 - 94 - min(){ 95 - ; Refocus last active Window 96 - Send {LAlt down}{tab}{LAlt up} 97 - } 98 - 99 - tray_suspend(){ 100 - suspend toggle 101 - if (a_isSuspended = 1){ 102 - Gosub ReleaseModifiers 103 - menu, tray, check , Suspend Kinto 104 - I_Icon = %A_ScriptDir%\assets\kinto-white.ico 105 - Menu, Tray, Icon, %I_Icon%,, 1 106 - Menu, Tray, Tip, Suspended - Kinto 107 - IfWinExist, detectUSB.ahk 108 - WinClose 109 - } 110 - else{ 111 - menu, tray, unCheck, Suspend Kinto 112 - ; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; MacModifiers 113 - I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; WinModifiers/CB/IBM 114 - ; Menu, Tray, Tip, Mac - Kinto ; MacModifiers 115 - Menu, Tray, Tip, Windows - Kinto ; WinModifiers 116 - ; Menu, Tray, Tip, Chromebook - Kinto ; Chromebook 117 - ; Menu, Tray, Tip, IBM - Kinto ; IBM 118 - Menu, Tray, Icon, %I_Icon%,,1 119 - Run, %A_ScriptDir%\detectUSB.ahk 120 - } 121 - ; Refocus last active Window 122 - Send {LAlt down}{tab}{LAlt up} 123 - } 124 - 125 - Exit() { 126 - Gosub ReleaseModifiers 127 - IfWinExist, detectUSB.ahk 128 - WinClose 129 - 130 - ExitApp 131 - } 132 - 133 - SetTitleMatchMode, 2 134 - 135 - GroupAdd, terminals, ahk_exe ubuntu.exe 136 - GroupAdd, terminals, ahk_exe ubuntu2004.exe 137 - GroupAdd, terminals, ahk_exe ConEmu.exe 138 - GroupAdd, terminals, ahk_exe ConEmu64.exe 139 - GroupAdd, terminals, ahk_exe powershell.exe 140 - GroupAdd, terminals, ahk_exe WindowsTerminal.exe 141 - GroupAdd, terminals, ahk_exe Hyper.exe 142 - GroupAdd, terminals, ahk_exe mintty.exe 143 - GroupAdd, terminals, ahk_exe Cmd.exe 144 - GroupAdd, terminals, ahk_exe box.exe 145 - GroupAdd, terminals, ahk_exe Terminus.exe 146 - GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow 147 - GroupAdd, terminals, ahk_class Console_2_Main 148 - 149 - ;; Vscode has integrated terminal and neovim bindings which act similar to terminals: 150 - GroupAdd, terminals, ahk_exe Code.exe 151 - 152 - GroupAdd, posix, ahk_exe ubuntu.exe 153 - GroupAdd, posix, ahk_exe ubuntu2004.exe 154 - GroupAdd, posix, ahk_exe ConEmu.exe 155 - GroupAdd, posix, ahk_exe ConEmu64.exe 156 - GroupAdd, posix, ahk_exe Hyper.exe 157 - GroupAdd, posix, ahk_exe mintty.exe 158 - GroupAdd, posix, ahk_exe Terminus.exe 159 - GroupAdd, posix, Fluent Terminal ahk_class ApplicationFrameWindow 160 - GroupAdd, posix, ahk_class Console_2_Main 161 - GroupAdd, posix, ahk_exe WindowsTerminal.exe 162 - 163 - ;; Vscode has integrated terminal and neovim bindings which act similar to posix: 164 - GroupAdd, posix, ahk_exe Code.exe 165 - 166 - GroupAdd, ConEmu, ahk_exe ConEmu.exe 167 - GroupAdd, ConEmu, ahk_exe ConEmu64.exe 168 - 169 - GroupAdd, ExcPaste, ahk_exe Cmd.exe 170 - GroupAdd, ExcPaste, ahk_exe mintty.exe 171 - 172 - GroupAdd, editors, ahk_exe sublime_text.exe 173 - GroupAdd, editors, ahk_exe VSCodium.exe 174 - GroupAdd, editors, ahk_exe Code.exe 175 - 176 - GroupAdd, browsers, ahk_exe chrome.exe 177 - GroupAdd, browsers, ahk_exe opera.exe 178 - GroupAdd, browsers, ahk_exe firefox.exe 179 - GroupAdd, browsers, ahk_exe msedge.exe 180 - 181 - ; Disable Key Remapping for Virtual Machines 182 - ; Disable for Remote desktop solutions too 183 - GroupAdd, remotes, ahk_exe VirtualBoxVM.exe 184 - GroupAdd, remotes, ahk_exe mstsc.exe 185 - GroupAdd, remotes, ahk_exe anydesk.exe 186 - GroupAdd, remotes, ahk_exe msrdc.exe 187 - GroupAdd, remotes, ahk_exe nxplayer.bin 188 - GroupAdd, remotes, ahk_exe vmconnect.exe 189 - GroupAdd, remotes, ahk_exe RemoteDesktopManagerFree.exe 190 - GroupAdd, remotes, ahk_exe vncviewer.exe 191 - GroupAdd, remotes, Remote Desktop ahk_class ApplicationFrameWindow 192 - 193 - ; Disabled Edge for now - no ability to close all instances 194 - ; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow 195 - 196 - GroupAdd, vscode, ahk_exe VSCodium.exe 197 - GroupAdd, vscode, ahk_exe Code.exe 198 - 199 - GroupAdd, vstudio, ahk_exe devenv.exe 200 - 201 - GroupAdd, intellij, ahk_exe idea.exe 202 - GroupAdd, intellij, ahk_exe idea64.exe 203 - 204 - ; SetCapsLockState, AlwaysOff ; CB/IBM 205 - 206 - ; Keyboards w/o media keys can use this Remap 207 - ; This will replace unneeded dedicated keys 208 - ; with most commonly used media keys 209 - ; 210 - ; Insert::SoundSet, +1, , mute ; Toggles Speaker 211 - ; +Insert::Insert ; Shift Insert maps to Insert 212 - ; Home::SoundSetWaveVolume, -10 ; Decrease volume 213 - ; PgUp::SoundSetWaveVolume, +10 ; Increase volume 214 - ; Delete::Send {Media_Prev} ; Previous 215 - ; End::Send {Media_Play_Pause} ; Pause/Play 216 - ; PgDn::Send {Media_Next} ; Next 217 - 218 - ; Virtual Desktop Hack via TotalSpaces2 - macOS Remote Desktop 219 - ; Custom Bind Gestures in Windows 220 - ; Shift-F8 on Left Swipe 221 - ; Shift-F9 on Right Swipe 222 - #IfWinActive ahk_exe nxplayer.bin 223 - +F8::Send !+- ; macOS TotalSpaces2 - Space Left 224 - +F6::Send !+= ; macOS TotalSpaces2 - Space Right 225 - #If 226 - ; +F8::Send {LCtrl down}{LWin down}{left}{LCtrl up}{LWin up} ; Comment out on host machine 227 - ; +F6::Send {LCtrl down}{LWin down}{right}{LCtrl up}{LWin up} ; Comment out on host machine 228 - 229 - ; ######################################################################### 230 - ; ############# START OF FINDER MODS FOR FILE MANAGERS ################ 231 - ; ######################################################################### 232 - ; Finder Mods for Windows File Explorer (explore.exe) 233 - #IfWinActive ahk_class CabinetWClass ahk_exe explorer.exe 234 - ^i::Send !{Enter} ; Cmd+i: Get Info / Properties 235 - ^r::Send {F5} ; Cmd+R: Refresh view (Not actually a Finder shortcut? But works in Linux file browsers too.) 236 - ^1::Send ^+2 ; Cmd+1: View as Icons 237 - ^2::Send ^+6 ; Cmd+2: View as List (Detailed) 238 - ^3::Send ^+5 ; Cmd+3: View as List (Compact) 239 - ^4::Send ^+1 ; Cmd+4: View as Gallery 240 - ^Up::Send !{Up} ; Cmd+Up: Up to parent folder 241 - ^Left::Send !{Left} ; Cmd+Left: Go to prior location in history 242 - ^Right::Send !{Right} ; Cmd+Right: Go to next location in history 243 - ^Down:: ; Cmd-Down: Navigate into the selected directory 244 - For window in ComObjCreate("Shell.Application").Windows 245 - If WinActive() = window.hwnd 246 - For item in window.document.SelectedItems { 247 - window.Navigate(item.Path) 248 - Return 249 - } 250 - Return 251 - ^[::Send !{Left} ; Cmd+Left_Brace: Go to prior location in history 252 - ^]::Send !{Right} ; Cmd+Right_Brace: Go to next location in history 253 - ^+o::Send ^{Enter} ; Cmd+Shift+o: Open in new window (tabs not available) 254 - ^Delete::Send {Delete} ; Cmd+Delete: Delete / Send to Trash 255 - ^BackSpace::Send {Delete} ; Cmd+Delete: Delete / Send to Trash 256 - ^d::return, ; Block the unusual Explorer "delete" shortcut of Ctrl+D, used for "bookmark" in similar apps 257 - $Enter:: ; Use Enter key to rename (F2), unless focus is inside a text input field. 258 - ControlGetFocus, fc, A 259 - If fc contains Edit,Search,Notify,Windows.UI.Core.CoreWindow1,SysTreeView321 260 - Send {Enter} 261 - Else Send {F2} 262 - Return 263 - $BackSpace:: ; Backspace (without Cmd): Block Backspace key with error beep, unless inside text input field 264 - ControlGetFocus, fc, A 265 - If fc contains Edit,Search,Notify,Windows.UI.Core.CoreWindow1 266 - Send {BackSpace} 267 - Else SoundBeep, 600, 300 268 - Return 269 - $Delete:: ; Delete (without Cmd): Block Delete key with error beep, unless inside text input field 270 - ControlGetFocus, fc, A 271 - If fc contains Edit,Search,Notify,Windows.UI.Core.CoreWindow1 272 - Send {Delete} 273 - Else SoundBeep, 600, 300 274 - Return 275 - #IfWinActive 276 - ; ######################################################################### 277 - ; ############## END OF FINDER MODS FOR FILE MANAGERS ################# 278 - ; ######################################################################### 279 - 280 - #IfWinNotActive ahk_group remotes 281 - ; wordwise support 282 - ^Up::Send ^{Home} 283 - ^+Up::Send ^+{Home} 284 - ^Down::Send ^{End} 285 - ^+Down::Send ^+{End} 286 - $^Backspace::Send +{Home}{Delete} 287 - !Backspace::Send ^{Backspace} 288 - !Left::Send ^{Left} 289 - !+Left::Send ^+{Left} 290 - !Right::Send ^{Right} 291 - !+Right::Send ^+{Right} 292 - $^Left::Send {Home} 293 - $^+Left::Send +{Home} 294 - $^Right::Send {End} 295 - $^+Right::Send +{End} 296 - #If 297 - 298 - #IfWinNotActive ahk_group remotes 299 - 300 - ; New AltTab and CtrlTab fix 301 - *tab:: 302 - { 303 - ; Tertiary 304 - if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) { 305 - ; Secondary 306 - ; Send {LCtrl down}{Secondary up}{tab} 307 - Send {LCtrl down}{LWin up}{tab} ; WinModifiers 308 - ; ; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers 309 - ; ; Send {LCtrl down}{CapsLock up}{tab} ; CB/IBM 310 - KeyWait, tab 311 - ; Tertiary 312 - } else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) { 313 - ; Secondary 314 - ; Send {LCtrl down}{Secondary up}{LShift down}{tab} 315 - Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers/CB 316 - ; ; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers 317 - ; ; Send {LCtrl down}{CapsLock up}{LShift down}{tab} ; IBM 318 - KeyWait, tab 319 - ; Primary 320 - } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers/CB/IBM 321 - ; ; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers 322 - Send {LAlt down}{tab} 323 - KeyWait, tab 324 - ; Primary 325 - } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers/CB/IBM 326 - ; ; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers 327 - Send {LAlt down}{LShift down}{tab} 328 - KeyWait, tab 329 - ; Secondary 330 - } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers/CB 331 - ; ; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers 332 - ; ; } else if (GetKeyState("CapsLock", "P") AND GetKeyState("LShift", "P")) = false { ; IBM 333 - return 334 - ; Secondary 335 - } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers/CB 336 - ; ; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers 337 - ; ; } else if (GetKeyState("CapsLock", "P") AND GetKeyState("LShift", "P")) { ; IBM 338 - return 339 - } else { 340 - send {Blind}{tab} 341 - } 342 - return 343 - } 344 - 345 - tab::Send {tab} 346 - 347 - +tab::Send {Shift down}{tab}{Shift up} 348 - 349 - ; Basic Remap 350 - ; 351 - ; Primary::LCtrl 352 - ; Secondary::LAlt 353 - ; Tertiary::LWin 354 - 355 - ; ; $LAlt::LCtrl ; CB/IBM 356 - ; ; $RAlt::RCtrl ; IBM 357 - ; ; $RCtrl::RAlt ; CB/IBM 358 - ; ; $CapsLock::LWin ; IBM 359 - ; ; $LCtrl::LAlt ; CB/IBM 360 - 361 - $LAlt::LCtrl ; WinModifiers 362 - $RAlt::RCtrl ; WinModifiers 363 - $RCtrl::RAlt ; WinModifiers 364 - $LWin::LAlt ; WinModifiers 365 - $LCtrl::LWin ; WinModifiers 366 - 367 - ; ; $LWin::LCtrl ; MacModifiers 368 - ; ; $RWin::RCtrl ; MacModifiers 369 - ; ; $LCtrl::LWin ; MacModifiers 370 - 371 - ; Hack to disable start menu on winkey 372 - ; Static - Does not apply to IBM or Chromebooks 373 - $LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up} ; Default 374 - ; ; LWin::return ; Chromebook 375 - ; ; RWin::return ; Chromebook 376 - ; ; RAlt::return ; Chromebook 377 - 378 - ; Disable Win-Up/Down - interferes with Sublime text 3 multi-cursors 379 - #Down::return 380 - #Up::return 381 - 382 - ; temporary hack to ensure keys don't get stuck 383 - ; impacts Alt-Tab fix 384 - ; Primary 385 - $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers 386 - ; ; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers 387 - ; ; $LAlt up::Send {LWin up}{CapsLock up}{LAlt up}{LCtrl up} ; CB/IBM 388 - 389 - !Enter:: 390 - { 391 - if (GetKeyState("RAlt", "P")) { 392 - Send {Insert} 393 - } 394 - else{ 395 - Send {Alt down}{Enter}{Alt up} 396 - } 397 - Return 398 - } 399 - 400 - ; Remap Alt+Esc to Break/Pause 401 - !Esc::SendInput, {Pause} 402 - 403 - ; Go up or down a page 404 - #IfWinNotActive ahk_group editors 405 - $!Down::Send {PgDn} 406 - $!Up::Send {PgUp} 407 - #If 408 - 409 - ; Close Apps 410 - ^q::Send !{F4} 411 - 412 - ; Minimize specific Window 413 - ^m::WinMinimize, A 414 - 415 - ; Minimize all but Active Window 416 - !^m:: 417 - WinGet, winid ,, A 418 - WinMinimizeAll 419 - WinActivate ahk_id %winid% 420 - return 421 - 422 - ; hide all instances of active Program 423 - ^h:: 424 - WinGetClass, class, A 425 - WinGet, AllWindows, List 426 - loop %AllWindows% { 427 - WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index% 428 - if(InStr(WinClass,class)){ 429 - WinMinimize, % "ahk_id " AllWindows%A_Index% 430 - } 431 - } 432 - return 433 - 434 - ; hide all but active program 435 - !^h:: 436 - WinGetClass, class, A 437 - WinMinimizeAll 438 - WinGet, AllWindows, List 439 - loop %AllWindows% { 440 - WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index% 441 - if(InStr(WinClass,class)){ 442 - WinRestore, % "ahk_id " AllWindows%A_Index% 443 - } 444 - } 445 - return 446 - 447 - ; Show Desktop 448 - ^F3::Send #d 449 - 450 - ; Emoji Panel 451 - #^Space::Send {LWin down};{LWin up} ; Default 452 - ; ; !^Space::Send {LWin down};{LWin up} ; CB/IBM 453 - 454 - ; Full Screenshot 455 - ^+3::Send {PrintScreen} 456 - 457 - ; Region Screenshot 458 - ^+4::Send #+{S} 459 - 460 - ; Open File Browser 461 - !^space::Send #e ; Default 462 - ; ; #^space::Send #e ; CB/IBM 463 - 464 - ; ; #if GetKeyState("LWin", "P") || GetKeyState("RAlt", "P") ; Chromebook 465 - ; ; Space::Send ^{Esc} ; Chromebook 466 - ; ; 0::Send #0 ; Chromebook 467 - ; ; 1::Send #1 ; Chromebook 468 - ; ; 2::Send #2 ; Chromebook 469 - ; ; 3::Send #3 ; Chromebook 470 - ; ; 4::Send #4 ; Chromebook 471 - ; ; 5::Send #5 ; Chromebook 472 - ; ; 6::Send #6 ; Chromebook 473 - ; ; 7::Send #7 ; Chromebook 474 - ; ; 8::Send #8 ; Chromebook 475 - ; ; 9::Send #9 ; Chromebook 476 - ; ; -::Send #- ; Chromebook 477 - ; ; =::Send #= ; Chromebook 478 - ; ; `::Send #` ; Chromebook 479 - ; ; `;::Send #; ; Chromebook 480 - ; ; a::Send #a ; Chromebook 481 - ; ; b::Send #b ; Chromebook 482 - ; ; c::Send #c ; Chromebook 483 - ; ; d::Send #d ; Chromebook 484 - ; ; e::Send #e ; Chromebook 485 - ; ; f::Send #f ; Chromebook 486 - ; ; g::Send #g ; Chromebook 487 - ; ; h::Send #h ; Chromebook 488 - ; ; i::Send #i ; Chromebook 489 - ; ; j::Send #j ; Chromebook 490 - ; ; k::Send #k ; Chromebook 491 - ; ; l::Send #l ; Chromebook 492 - ; ; m::Send #m ; Chromebook 493 - ; ; n::Send #n ; Chromebook 494 - ; ; o::Send #o ; Chromebook 495 - ; ; p::Send #p ; Chromebook 496 - ; ; q::Send #q ; Chromebook 497 - ; ; r::Send #r ; Chromebook 498 - ; ; s::Send #s ; Chromebook 499 - ; ; t::Send #t ; Chromebook 500 - ; ; u::Send #u ; Chromebook 501 - ; ; v::Send #v ; Chromebook 502 - ; ; w::Send #w ; Chromebook 503 - ; ; x::Send #x ; Chromebook 504 - ; ; y::Send #y ; Chromebook 505 - ; ; z::Send #z ; Chromebook 506 - ; ; #If ; Chromebook 507 - 508 - #If Not WinActive("ahk_group terminals") and Not WinActive("ahk_group remotes") 509 - ^.::Send {Esc} 510 - ; emacs style 511 - #n::Send {Down} 512 - #p::Send {Up} 513 - #f::Send {Right} 514 - #b::Send {Left} 515 - #a::Send {Home} 516 - #e::Send {End} 517 - #d::Send {Delete} 518 - #k::Send +{End}{Backspace} 519 - #If 520 - 521 - ; Cmd+Space Alternative 522 - $^Space::Send ^{Esc} 523 - 524 - #IfWinActive ahk_group intellij 525 - $#c::Send ^{c} ; Default - Sigints interrupt 526 - ; ; $!c::Send ^{c} ; CB/IBM 527 - ; General 528 - ^0::Send !{0} ;Open corresponding tool window 529 - ^1::Send !{1} ;Open corresponding tool window 530 - ^2::Send !{2} ;Open corresponding tool window 531 - ^3::Send !{3} ;Open corresponding tool window 532 - ^4::Send !{4} ;Open corresponding tool window 533 - ^5::Send !{5} ;Open corresponding tool window 534 - ^6::Send !{6} ;Open corresponding tool window 535 - ^7::Send !{7} ;Open corresponding tool window 536 - ^8::Send !{8} ;Open corresponding tool window 537 - ^9::Send !{9} ;Open corresponding tool window 538 - #`::Send ^` ;Quick switch current scheme 539 - ^,::Send ^!s ;Open Settings dialog 540 - ^;::Send ^!+s ;Open Project Structure dialog 541 - ; Debugging 542 - ^!r::Send {F9} ;Resume program 543 - ; Search/Replace 544 - ^g::Send {F3} ;Find next 545 - ^+F3::Send +{F3} ;Find previous 546 - #g::Send !j ;Select next occurrence 547 - ^#g::Send ^!+j ;Select all occurrences 548 - #+g::Send !+j ;Unselect occurrence 549 - ; Editing 550 - #Space::Send ^{Space} ; Default - Basic code completion 551 - ; ; !Space::Send ^{Space} ; CB/IBM - Basic code completion 552 - #+Space::Send ^+{Space} ;Smart code completion 553 - #j::Send ^q ;Quick documentation lookup 554 - ^n::Send !{Insert} ;Generate code... 555 - #o::Send ^o ;Override methods 556 - #i::Send ^i ;Implement methods 557 - !Up::Send ^w ;Extend selection 558 - !Down::Send ^+w ;Shrink selection 559 - #+q::Send !q ;Context info 560 - #!o::Send ^!o ;Optimize imports 561 - #!i::Send ^!i ;Auto-indent line(s) 562 - $^Backspace::Send ^y ;Delete line at caret 563 - #+j::Send ^+j ;Smart line join 564 - !Delete::Send ^{Delete} ;Delete to word end 565 - !Backspace::Send ^{Backspace} ;Delete to word start 566 - ^+::Send ^{NumpadAdd} ;Expand code block 567 - ^-::Send ^{NumpadSub} ;Collapse code block 568 - ^++::Send ^+{NumpadAdd} ;Expand all 569 - ^+-::Send ^+{NumpadSub} ;Collapse all 570 - ^w::Send ^{F4} ;Close active editor tab 571 - ; Refactoring 572 - ^Delete::Send !{Delete} ;Safe Delete 573 - ^T::Send ^!+T ;Refactor this 574 - ; Navigation 575 - ^o::Send ^n ;Go to class 576 - ^+o::Send ^+n ;Go to file 577 - ^!o::Send ^!+n ;Go to symbol 578 - #Right::Send !{Right} ;Go to next editor tab 579 - #Left::Send !{Left} ;Go to previous editor tab 580 - #l::Send ^g ;Go to line 581 - #e::Send ^e ;Recent files popup 582 - !Space::Send ^+i ; Default - Open quick definition lookup 583 - ; ; #Space::Send ^+i ; CB/IBM - Open quick definition lookup 584 - ^Y::Send ^+i ;Open quick definition lookup 585 - #+b::Send ^+b ;Go to type declaration 586 - #Up::Send !{Up} ;Go to previous 587 - #Down::Send !{Down} ;Go to next method 588 - #h::Send ^h ;Type hierarchy 589 - #!h::Send ^!h ;Call hierarchy 590 - ^Down::Send ^{Enter} ;Edit source/View source 591 - !Home::Send !{Home} ;Show navigation bar 592 - F2::Send {F11} ;Toggle bookmark 593 - #F3::Send ^{F11} ;Toggle bookmark with mnemonic 594 - #0::Send ^{0} ;Go to numbered bookmark 595 - #1::Send ^{1} ;Go to numbered bookmark 596 - #2::Send ^{2} ;Go to numbered bookmark 597 - #3::Send ^{3} ;Go to numbered bookmark 598 - #4::Send ^{4} ;Go to numbered bookmark 599 - #5::Send ^{5} ;Go to numbered bookmark 600 - #6::Send ^{6} ;Go to numbered bookmark 601 - #7::Send ^{7} ;Go to numbered bookmark 602 - #8::Send ^{8} ;Go to numbered bookmark 603 - #9::Send ^{9} ;Go to numbered bookmark 604 - ^F3::Send +{F11} ;Show bookmarks 605 - ; Compile and Run 606 - #!r::Send !+{F10} ;Select configuration and run 607 - #!d::Send !+{F9} ;Select configuration and debug 608 - #r::Send +{F10} ;Run 609 - #d::Send +{F9} ;Debug 610 - #+r::Send ^+{F10} ;Run context configuration from editor 611 - #+d::Send ^+{F9} ;Debug context configuration from editor 612 - ; VCS/Local History 613 - #v::Send !` ;VCS quick popup 614 - #If 615 - 616 - ; Close all browsers 617 - #IfWinActive ahk_group browsers 618 - ; Page Navigation 619 - ^[::send !{Left} ; Go to prior page 620 - ^]::send !{Right} ; Go to next page 621 - ;Tab Navigation 622 - ^+[::send ^{PgUp} ; Go to prior tab (left) 623 - ^+]::send ^{PgDn} ; Go to next tab (right) 624 - ^!Left::send ^{PgUp} ; Go to prior tab (left) 625 - ^!Right::send ^{PgDn} ; Go to next tab (right) 626 - #Left::send ^{PgUp} ; Go to prior tab (left) 627 - #Right::send ^{PgDn} ; Go to next tab (right) 628 - ^q::send {Alt Down}f{Alt Up}x ; exit all windows 629 - ; Dev Tools 630 - !^i::send {Ctrl Down}{Shift Down}i{Shift Up}{Ctrl Up} 631 - !^j::send {Ctrl Down}{Shift Down}j{Shift Up}{Ctrl Up} 632 - ; Open preferences 633 - #IfWinActive ahk_exe firefox.exe 634 - ^,::send, {Ctrl Down}t{Ctrl Up}about:preferences{Enter} 635 - ^+n::send ^+p 636 - #If 637 - #IfWinActive ahk_exe chrome.exe 638 - ^,::send {Alt Down}e{Alt Up}s{Enter} 639 - #If 640 - #IfWinActive ahk_exe msedge.exe 641 - ^,::send {Alt Down}e{Alt Up}s{Enter} 642 - #If 643 - #IfWinActive ahk_exe opera.exe 644 - ^,::send {Ctrl Down}{F12}{Ctrl Up} 645 - #If 646 - #If 647 - 648 - ; Sublime Text Remaps for VS Code 649 - #IfWinActive ahk_group vscode 650 - #p::send {Up} ; Allow for traversing quick list 651 - #n::send {Down} ; Allow for traversing quick list 652 - ; Remap Ctrl+Shift to behave like macOS Sublimetext 653 - ; Will extend cursor to multiple lines 654 - #+Up::send ^!{Up} ; Default - ST2CODE 655 - ; ; !+Up::send ^!{Up} ; CB/IBM - ST2CODE 656 - #+Down::send ^!{Down} ; Default - ST2CODE 657 - ; ; !+Down::send ^!{Down} ; CB/IBM - ST2CODE 658 - ; Remap Ctrl+Cmd+G to select all matches 659 - #^g::send ^+{L} ; Default - ST2CODE 660 - ; ; !^g::send ^+{L} ; CB/IBM - ST2CODE 661 - !+g::send ^+{G} ; View source control 662 - $#c::Send {Ctrl down}c{Ctrl up} ; Default - Sigints interrupt 663 - ; ; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM 664 - $#x::Send {Ctrl down}x{Ctrl up} ; Default - Sigints interrupt 665 - ; ; $!x::Send {Ctrl down}x{Ctrl up} ; CB/IBM 666 - 667 - #Space::Send ^{Space} ; Default - Basic code completion 668 - ; ; !Space::Send ^{Space} ; CB/IBM - Basic code completion 669 - #If 670 - 671 - #IfWinActive ahk_exe sublime_text.exe 672 - #x::Send ^{x} ; Default - Terminal - Ctrl-x 673 - #c::Send ^{c} ; Default - Terminal - Ctrl-c sigint 674 - ; ; !x::Send ^{x} ; CB/IBM 675 - ; ; !c::Send ^{c} ; CB/IBM - Sigint 676 - ; #c::send ^{Pause} ; cancel_build 677 - #Space::Send ^{Space} ; Default - Basic code completion 678 - ; ; !Space::Send ^{Space} ; CB/IBM - Basic code completion 679 - #^Up::send !{O} ; Switch file 680 - #^f::send {F11} ; toggle_full_screen 681 - ^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history 682 - ^Up::Return ; cancel scroll_lines up 683 - ^!Up::send ^{Up} ; scroll_lines up 684 - ^Down::Return ; cancel scroll_lines down 685 - ^!Down::send ^{Down} ; scroll_lines down 686 - #+Up::send {shift up}^!{Up} ; Default - multi-cursor up 687 - #+Down::send {shift up}^!{Down} ; Default - multi-cursor down 688 - ; ; !+Up::send {shift up}^!{Up} ; CB/IBM - multi-cursor up 689 - ; ; !+Down::send {shift up}^!{Down} ; CB/IBM - multi-cursor down 690 - ^PgDn::Return ; cancel next_view 691 - ^PgUp::Return ; cancel prev_view 692 - ^+{::send ^{PgDn} ; next_view 693 - ^+}::send ^{PgUp} ; prev_view 694 - ^!Right::send ^{PgDn} ; next_view 695 - ^!Left::send ^{PgUp} ; prev_view 696 - Insert::Return ; cancel toggle_overwrite 697 - ^!O::send {Insert} ; toggle_overwrite 698 - !c::Return ; Default - cancel toggle_case_sensitive 699 - ^!c::send !{c} ; toggle_case_sensitive 700 - ; ^h::Return ; cancel replace 701 - ^!f::send ^{h} ; replace 702 - ^+h::Return ; cancel replace_next 703 - ^!e::send ^+{h} ; replace_next 704 - F3::Return ; cancel find_next 705 - ^g::send {F3} ; find_next 706 - #g::send ^{g} ; goto line - disable game bar - Start menu -> Game bar shortcuts -> toggle Off 707 - *F3::Return ; cancel find_prev, find_under, find_all_under 708 - ^+g::send +{F3} ; find_prev 709 - #!g::send ^{F3} ; find_under 710 - #!+g::send ^+{F3} ; find_under_prev 711 - #^g::send !{F3} ; Default - find_all_under 712 - ; ; !^g::send !{F3} ; CB/IBM - find_all_under 713 - ^+Up::Return ; cancel swap_line_up 714 - #!Up::send ^+{Up} ; swap_line_up 715 - ^+Down::Return ; cancel swap_line_down 716 - #!Down::send ^+{Down} ; swap_line_down 717 - ^Pause::Return ; cancel cancel_build 718 - ; #c::send ^{Pause} ; cancel_build 719 - F9::Return ; cancel sort_lines case_s false 720 - F5::send {F9} ; sort_lines case_s false 721 - #F9::Return ; cancel sort_lines case_s true 722 - #F5::send #{F9} ; sort_lines case_s true 723 - !+1::Return ; cancel set_layout 724 - ^!1::send !+1 ; set_layout 725 - !+2::Return ; cancel set_layout 726 - ^!2::send !+2 ; set_layout 727 - !+3::Return ; cancel set_layout 728 - ^!3::send !+3 ; set_layout 729 - !+4::Return ; cancel set_layout 730 - ^!4::send !+4 ; set_layout 731 - !+5::Return ; cancel set_layout 732 - ^!5::send !+5 ; set_layout 733 - !+8::Return ; cancel set_layout 734 - ^!8::send !+8 ; set_layout 735 - !+9::Return ; cancel set_layout 736 - ^!9::send !+9 ; set_layout 737 - #If 738 - 739 - #IfWinActive ahk_group terminals 740 - 741 - ; End of Line 742 - #e:: ; Default 743 - ; ; !e:: ; CB/IBM 744 - Send {End} 745 - return 746 - 747 - ; Beginning of Line 748 - #a:: ; Default 749 - ; ; !a:: ; CB/IBM 750 - Send {Home} 751 - return 752 - 753 - ; Copy 754 - ^c:: 755 - If WinActive("ahk_exe cmd.exe") OR WinActive("ahk_exe box.exe"){ 756 - Send {Enter} 757 - } 758 - else if WinActive("ahk_exe mintty.exe"){ 759 - SetKeyDelay -1 760 - Send {Blind}{Insert} 761 - } 762 - ; else if WinActive("ahk_exe WindowsTerminal.exe"){ ; WinTerm 763 - ; SetKeyDelay -1 ; WinTerm 764 - ; Send {Blind}{F13} ; WinTerm 765 - ; } ; WinTerm 766 - else{ 767 - SetKeyDelay -1 768 - Send {Blind}{LShift down}{c DownTemp} 769 - } 770 - return 771 - 772 - ^c up:: 773 - If not WinActive("ahk_group cmd.exe") OR WinActive("ahk_exe box.exe"){ 774 - SetKeyDelay -1 775 - Send {Blind}{c Up}{LShift Up} 776 - } 777 - return 778 - 779 - ; Sigints - interrupt 780 - $#c::Send {Ctrl down}c{Ctrl up} ; Default 781 - ; ; $!c::Send {Ctrl down}c{Ctrl up} ; CB/IBM 782 - $^.::Send {Ctrl down}c{Ctrl up} 783 - 784 - ; Windows Terminal 785 - ; Ctrl+Shift+C should do nothing 786 - If WinActive("ahk_exe WindowsTerminal.exe"){ 787 - $#+c::return 788 - } 789 - 790 - ; Paste 791 - $^v:: 792 - If WinActive("ahk_exe mintty.exe"){ 793 - Send {Shift down}{Insert}{Shift up} 794 - } 795 - else if WinActive("ahk_group posix"){ 796 - Send {Blind}{Shift down}v{Shift up} 797 - } 798 - else if WinActive("ahk_exe box.exe"){ 799 - SendEvent {RButton} 800 - } 801 - else{ 802 - Send {Blind}v 803 - } 804 - return 805 - #If 806 - 807 - #IfWinActive ahk_group posix 808 - ; Open/Close Tab for those that support it 809 - $^t:: 810 - If not WinActive("ahk_group ConEmu") AND not WinActive("ahk_class Console_2_Main"){ 811 - Send {Blind}{LShift down}t{LShift Up} 812 - } 813 - else if WinActive("ahk_class Console_2_Main"){ 814 - Send {Blind}{F1}{LShift Up} 815 - } 816 - else{ 817 - Send {Blind}t 818 - } 819 - return 820 - 821 - 822 - $^w:: 823 - If not WinActive("ahk_group ConEmu"){ 824 - Send {Blind}{LShift down}w{LShift Up} 825 - } 826 - else{ 827 - Send ^w 828 - } 829 - return 830 - 831 - ^l::Send clear{Enter} 832 - ; #l::return 833 - ; Clear Terminal and Scroll Buffer 834 - ^k::Send clear && printf '\e[3J'{Enter} 835 - ; Remap Physical Ctrl back to Ctrl 836 - #0::Send {LCtrl down}0{Ctrl up} ; Default 837 - #1::Send {LCtrl down}1{Ctrl up} ; Default 838 - #2::Send {LCtrl down}2{Ctrl up} ; Default 839 - #3::Send {LCtrl down}3{Ctrl up} ; Default 840 - #4::Send {LCtrl down}4{Ctrl up} ; Default 841 - #5::Send {LCtrl down}5{Ctrl up} ; Default 842 - #6::Send {LCtrl down}6{Ctrl up} ; Default 843 - #7::Send {LCtrl down}7{Ctrl up} ; Default 844 - #8::Send {LCtrl down}8{Ctrl up} ; Default 845 - #9::Send {LCtrl down}9{Ctrl up} ; Default 846 - #-::Send {LCtrl down}-{Ctrl up} ; Default 847 - #=::Send {LCtrl down}={Ctrl up} ; Default 848 - #`::Send {LCtrl down}`{Ctrl up} ; Default 849 - #a::Send {LCtrl down}a{Ctrl up} ; Default 850 - #b::Send {LCtrl down}b{Ctrl up} ; Default 851 - #c::Send {LCtrl down}c{Ctrl up} ; Default 852 - #d::Send {LCtrl down}d{Ctrl up} ; Default 853 - #e::Send {LCtrl down}e{Ctrl up} ; Default 854 - #f::Send {LCtrl down}f{Ctrl up} ; Default 855 - #g::Send {LCtrl down}g{Ctrl up} ; Default 856 - #h::Send {LCtrl down}h{Ctrl up} ; Default 857 - #i::Send {LCtrl down}i{Ctrl up} ; Default 858 - #j::Send {LCtrl down}j{Ctrl up} ; Default 859 - #k::Send {LCtrl down}k{Ctrl up} ; Default 860 - #l::Send {LCtrl down}l{Ctrl up} ; Default 861 - #m::Send {LCtrl down}m{Ctrl up} ; Default 862 - #n::Send {LCtrl down}n{Ctrl up} ; Default 863 - #o::Send {LCtrl down}o{Ctrl up} ; Default 864 - #p::Send {LCtrl down}p{Ctrl up} ; Default 865 - #q::Send {LCtrl down}q{Ctrl up} ; Default 866 - #r::Send {LCtrl down}r{Ctrl up} ; Default 867 - #s::Send {LCtrl down}s{Ctrl up} ; Default 868 - #t::Send {LCtrl down}t{Ctrl up} ; Default 869 - #u::Send {LCtrl down}u{Ctrl up} ; Default 870 - #v::Send {LCtrl down}v{Ctrl up} ; Default 871 - #w::Send {LCtrl down}w{Ctrl up} ; Default 872 - #x::Send {LCtrl down}x{Ctrl up} ; Default 873 - #y::Send {LCtrl down}y{Ctrl up} ; Default 874 - #z::Send {LCtrl down}z{Ctrl up} ; Default 875 - ; ; !0::Send {LCtrl down}0{Ctrl up} ; CB/IBM 876 - ; ; !1::Send {LCtrl down}1{Ctrl up} ; CB/IBM 877 - ; ; !2::Send {LCtrl down}2{Ctrl up} ; CB/IBM 878 - ; ; !3::Send {LCtrl down}3{Ctrl up} ; CB/IBM 879 - ; ; !4::Send {LCtrl down}4{Ctrl up} ; CB/IBM 880 - ; ; !5::Send {LCtrl down}5{Ctrl up} ; CB/IBM 881 - ; ; !6::Send {LCtrl down}6{Ctrl up} ; CB/IBM 882 - ; ; !7::Send {LCtrl down}7{Ctrl up} ; CB/IBM 883 - ; ; !8::Send {LCtrl down}8{Ctrl up} ; CB/IBM 884 - ; ; !9::Send {LCtrl down}9{Ctrl up} ; CB/IBM 885 - ; ; !-::Send {LCtrl down}-{Ctrl up} ; CB/IBM 886 - ; ; !=::Send {LCtrl down}={Ctrl up} ; CB/IBM 887 - ; ; !`::Send {LCtrl down}`{Ctrl up} ; CB/IBM 888 - ; ; !a::Send {LCtrl down}a{Ctrl up} ; CB/IBM 889 - ; ; !b::Send {LCtrl down}b{Ctrl up} ; CB/IBM 890 - ; ; !c::Send {LCtrl down}c{Ctrl up} ; CB/IBM 891 - ; ; !d::Send {LCtrl down}d{Ctrl up} ; CB/IBM 892 - ; ; !e::Send {LCtrl down}e{Ctrl up} ; CB/IBM 893 - ; ; !f::Send {LCtrl down}f{Ctrl up} ; CB/IBM 894 - ; ; !g::Send {LCtrl down}g{Ctrl up} ; CB/IBM 895 - ; ; !h::Send {LCtrl down}h{Ctrl up} ; CB/IBM 896 - ; ; !i::Send {LCtrl down}i{Ctrl up} ; CB/IBM 897 - ; ; !j::Send {LCtrl down}j{Ctrl up} ; CB/IBM 898 - ; ; !k::Send {LCtrl down}k{Ctrl up} ; CB/IBM 899 - ; ; !l::Send {LCtrl down}l{Ctrl up} ; CB/IBM 900 - ; ; !m::Send {LCtrl down}m{Ctrl up} ; CB/IBM 901 - ; ; !n::Send {LCtrl down}n{Ctrl up} ; CB/IBM 902 - ; ; !o::Send {LCtrl down}o{Ctrl up} ; CB/IBM 903 - ; ; !p::Send {LCtrl down}p{Ctrl up} ; CB/IBM 904 - ; ; !q::Send {LCtrl down}q{Ctrl up} ; CB/IBM 905 - ; ; !r::Send {LCtrl down}r{Ctrl up} ; CB/IBM 906 - ; ; !s::Send {LCtrl down}s{Ctrl up} ; CB/IBM 907 - ; ; !t::Send {LCtrl down}t{Ctrl up} ; CB/IBM 908 - ; ; !u::Send {LCtrl down}u{Ctrl up} ; CB/IBM 909 - ; ; !v::Send {LCtrl down}v{Ctrl up} ; CB/IBM 910 - ; ; !w::Send {LCtrl down}w{Ctrl up} ; CB/IBM 911 - ; ; !x::Send {LCtrl down}x{Ctrl up} ; CB/IBM 912 - ; ; !y::Send {LCtrl down}y{Ctrl up} ; CB/IBM 913 - ; ; !z::Send {LCtrl down}z{Ctrl up} ; CB/IBM 914 - #If 915 - #If 916 - 917 - ReleaseModifiers: 918 - Send {RCtrl up} 919 - Send {LCtrl up} 920 - Send {RAlt up} 921 - Send {LAlt up} 922 - Send {RWin up} 923 - Send {LWin up} 924 - Send {RShift up} 925 - Send {LShift up} 926 - return 927 - 928 - ; ############################################################################################################### 929 - ; ### Special character insertion like Apple/macOS Option key methods, mapping to Unicode input method 930 - ; ### Common symbols available with Option+key or Shift+Option+key, accented keys with Option+Key1, then Key2 931 - ; ############################################################################################################### 932 - 933 - ; Shortcut to activate Option key special character scheme 934 - ^+!o::Gosub, toggle_optspecialchars 935 - 936 - ; Function (subroutine?) for activation by tray menu item or keyboard shortcut 937 - toggle_optspecialchars: 938 - optspecialchars:=!optspecialchars ; Toggle value of optspecialchars variable on/off 939 - if (optspecialchars = 1) { 940 - Menu, Tray, Check, OptSpecialChars Shift+Opt+Cmd+O 941 - MsgBox, 0, ALERT, % "Option key special character entry scheme is now ENABLED.`n`n" 942 - . "WARNING: This will interfere with many Alt and Alt-Shift shortcuts.`n`n" 943 - . "Disable from tray menu or with Shift+Opt+Cmd+O." 944 - return 945 - } 946 - if (optspecialchars = 0) { 947 - Menu, Tray, Uncheck, OptSpecialChars Shift+Opt+Cmd+O 948 - MsgBox, 0, ALERT, Option key special character entry scheme is now DISABLED. 949 - return 950 - } 951 - return 952 - 953 - ; #IfWinNotActive ahk_group remotes 954 - #If !WinActive("ahk_group remotes") && optspecialchars = 1 955 - 956 - ; ###### NUMBER KEYS ROW ###### 957 - 958 - ; Dead_Keys_Accent_Grave 959 - ; ### SC029 is ` (Grave key above Tab) 960 - ; Grave accent: Option+`, then key to accent 961 - $!SC029:: 962 - ; Use Apple "dead keys" Option key method to attach accents to next character typed 963 - ; Grave accent activated by Option+` (Alt plus scan code SC029, or !SC029) 964 - StringCaseSense, On 965 - ; watch next input string 966 - Input, UserInput, L1 967 - Switch UserInput { 968 - Case Esc: Return ; Watch for Escape key, cancel dead keys sequence 969 - Case "a": Send, {U+00E0} ; à {U+00E0} (Alt+0224) 970 - Case "e": Send, {U+00E8} ; è {U+00E8} (Alt+0232) 971 - Case "i": Send, {U+00EC} ; ì {U+00EC} (Alt+0236) 972 - Case "o": Send, {U+00F2} ; ò {U+00F2} (Alt+0242) 973 - Case "u": Send, {U+00F9} ; ù {U+00F9} (Alt+0249) 974 - Case "A": Send, {U+00C0} ; À {U+00C0} (Alt+0192) 975 - Case "E": Send, {U+00C8} ; È {U+00C8} (Alt+0200) 976 - Case "I": Send, {U+00CC} ; Ì {U+00CC} (Alt+0204) 977 - Case "O": Send, {U+00D2} ; Ò {U+00D2} (Alt+0210) 978 - Case "U": Send, {U+00D9} ; Ù {U+00D9} (Alt+0217) 979 - Default: Send, %UserInput% ; No match? Send input through. 980 - } 981 - Return 982 - 983 - ; ### SC029 is ` (Grave key above Tab) 984 - $!+SC029::Send, {U+0060} ; Grave Accent diacritic (non-combining) {U+0060}: ` (Alt+96) 985 - $!1::Send, {U+00A1} ; Inverted Exclamation Mark {U+00A1}: ¡ (Alt+0161) 986 - $!+1::Send, {U+2044} ; Fraction Slash, solidus (U+2044): ⁄ (Alt+8260) [Needs Unicode] 987 - $!2::Send, {U+2122} ; Trade Mark Sign Emoji {U+2122}: ™ (Alt+0153) 988 - $!+2::Send, {U+20AC} ; Euro currency symbol {U+20AC}: € (Alt+0128) 989 - $!3::Send, {U+00A3} ; British Pound currency symbol {U+00A3}: £ (Alt+0163) 990 - $!+3::Send, {U+2039} ; Single Left-Pointing Angle Quotation mark {U+2039}: (Alt+0139) 991 - $!4::Send, {U+00A2} ; Cent currency symbol {U+00A2}: ¢ (Alt+0162) 992 - $!+4::Send, {U+203A} ; Single Right-Pointing Angle Quotation mark (U+203A): (Alt+0155) 993 - $!5::Send, {U+221E} ; Infinity mathematical symbol {U+221E}: ∞ (Alt+236) 994 - $!+5::Send, {U+FB01} ; fi latin small ligature: fi (U+FB01) (Alt+64257) [Needs Unicode] 995 - $!6::Send, {U+00A7} ; Section symbol {U+00A7}: § (Alt+0167) 996 - $!+6::Send, {U+FB02} ; fl small ligature: (U+FB02) (Alt+64258) [Needs Unicode.] 997 - $!7::Send, {U+00B6} ; Paragraph mark (Pilcrow) symbol {U+00B6}: ¶ (Alt+0182) 998 - $!+7::Send, {U+2021} ; Double dagger (cross) symbol {U+2021}: ‡ (Alt+0135) 999 - $!8::Send, {U+2022} ; Bullet point symbol {U+2022}: • (Alt+0149) 1000 - $!+8::Send, {U+00B0} ; Degree symbol {U+00B0}: ° (Alt+0176) 1001 - $!9::Send, {U+00AA} ; Feminine Ordinal Indicator symbol {U+00AA}: ª (Alt+0170) 1002 - $!+9::Send, {U+00B7} ; Middle Dot (interpunct/middot) symbol {U+00B7}: · (Alt+0183) 1003 - $!0::Send, {U+00BA} ; Masculine Ordinal Indicator symbol {U+00BA}: º (Alt+0186) 1004 - $!+0::Send, {U+201A} ; Single low-9 quotation mark {U+201A}: ‚ (Alt+0130) 1005 - $!-::Send, {U+2013} ; En Dash symbol {U+2013}: – (Alt+0150) 1006 - $!+-::Send, {U+2014} ; Em Dash symbol {U+2014}: — (Alt+0151) 1007 - $!=::Send, {U+2260} ; Not Equal To symbol (U+2260): ≠ (Alt+8800) [Needs Unicode] 1008 - $!+=::Send, {U+00B1} ; Plus Minus symbol {U+00B1}: ± (Alt+0177) 1009 - 1010 - 1011 - ; ###### LETTER AND PUNCTUATION KEYS ###### [ in QWERTY order ] 1012 - 1013 - ; ############## 1014 - ; ### 1st row: Tab-key row [ qwertyuiop[]\ ] [ QWERTYUIOP{}| ] 1015 - 1016 - $!q::Send, {U+0153} ; Small oe (oethel) ligature {U+0153}: œ (Alt+0156) 1017 - $!+q::Send, {U+0152} ; Capital OE (Oethel) ligature {U+0152}: Œ (Alt+0140) 1018 - $!w::Send, {U+2211} ; N-Ary Summation (sigma) notation (U+2211}: ∑ [Needs Unicode] 1019 - $!+w::Send, {U+201E} ; Double Low-9 Quotation mark {U+201E}: „ (Alt+0132) 1020 - 1021 - ; Dead_Keys_Accent_Acute 1022 - ; Acute accent: Option+e, then key to accent 1023 - $!e:: 1024 - ; Use Apple "dead keys" Option key method to attach accents to next character typed 1025 - ; Acute accent activated by Option+e (logical Alt+e) 1026 - StringCaseSense, On 1027 - ; watch next input string 1028 - Input, UserInput, L1 1029 - Switch UserInput { 1030 - Case Esc: Return ; Watch for Escape key, cancel dead keys sequence 1031 - Case "a": Send, {U+00E1} ; á {U+00E1} (Alt+0225) 1032 - Case "e": Send, {U+00E9} ; é {U+00E9} (Alt+0233) 1033 - Case "i": Send, {U+00ED} ; í {U+00ED} (Alt+0237) 1034 - Case "o": Send, {U+00F3} ; ó {U+00F3} (Alt+0243) 1035 - Case "u": Send, {U+00FA} ; ú {U+00FA} (Alt+0250) 1036 - Case "A": Send, {U+00C1} ; Á {U+00C1} (Alt+0193) 1037 - Case "E": Send, {U+00C9} ; É {U+00C9} (Alt+0201) 1038 - Case "I": Send, {U+00CD} ; Í {U+00CD} (Alt+0205) 1039 - Case "O": Send, {U+00D3} ; Ó {U+00D3} (Alt+0211) 1040 - Case "U": Send, {U+00DA} ; Ú {U+00DA} (Alt+0218) 1041 - Default: Send, %UserInput% ; No match? Send input through. 1042 - } 1043 - Return 1044 - 1045 - $!+e::Send, {U+00B4} ; Acute accent diacritic (non-combining) {U+00B4}: ´ (Alt+0180) 1046 - $!r::Send, {U+00AE} ; Registered Trade Mark Sign {U+00AE}: ® (Alt+0174) 1047 - $!+r::Send, {U+2030} ; Per mille symbol {U+2030}: ‰ (Alt+0137) 1048 - $!t::Send, {U+2020} ; Simple dagger (cross) symbol {U+2020}: † (Alt+0134) 1049 - $!+t::Send, {U+02C7} ; Caron/hacek diacritic (non-combining) (U+02C7): ˇ (Alt+0134) 1050 - $!y::Send, {U+00A5} ; Yen currency symbol {U+00A5}: ¥ (Alt+0165) 1051 - $!+y::Send, {U+00C1} ; Latin Capital Letter a with Acute (U+00C1): Á (Alt+0193) 1052 - 1053 - ; Dead_Keys_Accent_Umlaut 1054 - ; Umlaut/Diaeresis accent: Option+u, then key to accent 1055 - $!u:: 1056 - ; Use Apple "dead keys" Option key method to attach accents to next character typed 1057 - ; Umlaut/Diaeresis accent activated by Option+u (logical Alt+u) 1058 - StringCaseSense, On 1059 - ; watch next input string 1060 - Input, UserInput, L1 1061 - Switch UserInput { 1062 - Case Esc: Return ; Watch for Escape key, cancel dead keys sequence 1063 - Case "a": Send, {U+00E4} ; ä {U+00E4} (Alt+0228) 1064 - Case "e": Send, {U+00EB} ; ë {U+00EB} (Alt+0235) 1065 - Case "i": Send, {U+00EF} ; ï {U+00EF} (Alt+0239) 1066 - Case "o": Send, {U+00F6} ; ö {U+00F6} (Alt+0246) 1067 - Case "u": Send, {U+00FC} ; ü {U+00FC} (Alt+0252) 1068 - Case "y": Send, {U+00FF} ; ÿ {U+00FF} (Alt+0255) 1069 - Case "A": Send, {U+00C4} ; Ä {U+00C4} (Alt+0196) 1070 - Case "E": Send, {U+00CB} ; Ë {U+00CB} (Alt+0203) 1071 - Case "I": Send, {U+00CF} ; Ï {U+00CF} (Alt+0207) 1072 - Case "O": Send, {U+00D6} ; Ö {U+00D6} (Alt+0214) 1073 - Case "U": Send, {U+00DC} ; Ü {U+00DC} (Alt+0220) 1074 - Case "Y": Send, {U+0178} ; Ÿ {U+0178} (Alt+0159) 1075 - Default: Send, %UserInput% ; No match? Send input through. 1076 - } 1077 - Return 1078 - 1079 - $!+u::Send, {U+00A8} ; Umlaut/Diaeresis diacritic (non-combining) {U+00A8}: (Alt+0168) 1080 - 1081 - ; Dead_Keys_Accent_Circumflex 1082 - ; Circumflex accent: Option+i, then key to accent 1083 - $!i:: 1084 - ; Use Apple "dead keys" Option key method to attach accents to next character typed 1085 - ; Circumflex accent activated by Option+i (logical Alt+i) 1086 - StringCaseSense, On 1087 - ; watch next input string 1088 - Input, UserInput, L1 1089 - Switch UserInput { 1090 - Case Esc: Return ; Watch for Escape key, cancel dead keys sequence 1091 - Case "a": Send, {U+00E2} ; â {U+00E2} (Alt+0226) 1092 - Case "e": Send, {U+00EA} ; ê {U+00EA} (Alt+0234) 1093 - Case "i": Send, {U+00EE} ; î {U+00EE} (Alt+0238) 1094 - Case "o": Send, {U+00F4} ; ô {U+00F4} (Alt+0244) 1095 - Case "u": Send, {U+00FB} ; û {U+00FB} (Alt+0251) 1096 - Case "A": Send, {U+00C2} ;  {U+00C2} (Alt+0194) 1097 - Case "E": Send, {U+00CA} ; Ê {U+00CA} (Alt+0202) 1098 - Case "I": Send, {U+00CE} ; Î {U+00CE} (Alt+0206) 1099 - Case "O": Send, {U+00D4} ; Ô {U+00D4} (Alt+0212) 1100 - Case "U": Send, {U+00DB} ; Û {U+00DB} (Alt+0219) 1101 - Default: Send, %UserInput% ; No match? Send input through. 1102 - } 1103 - Return 1104 - 1105 - $!+i::Send, {U+02C6} ; Modifier Letter Circumflex Accent (U+02C6): ˆ (Alt+0137) 1106 - $!o::Send, {U+00F8} ; Latin Small Letter o with Stroke {U+00F8}: ø (Alt+0248) 1107 - $!+o::Send, {U+00D8} ; Latin Capital Letter O with Stroke {U+00D8}: Ø (Alt+0216) 1108 - $!p::Send, {U+03C0} ; Greek Small Letter Pi {U+03C0}: π (Alt+227) 1109 - $!+p::Send, {U+220F} ; N-Ary Product mathematical symbol (U+220F): ∏ [Needs Unicode] 1110 - $![::Send, {U+201C} ; Left Double Quotation Mark {U+201C}: “ (Alt+0147) 1111 - $!+[::Send, {U+201D} ; Right Double Quotation Mark {U+201D}: ” (Alt+8) 1112 - $!]::Send, {U+2018} ; Left Single Quotation Mark {U+2018}: ‘ (Alt+0145) 1113 - $+!]::Send, {U+2019} ; Right Single Quotation Mark {U+2019}: ’ (Alt+0146) 1114 - $!\::Send, {U+00AB} ; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK {U+00AB}: « (Alt+0171) 1115 - $!+\::Send, {U+00BB} ; RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK {U+00BB}: » (Alt+0187) 1116 - 1117 - 1118 - ; ############## 1119 - ; ### 2nd row: Caps Lock row [ asdfghjkl;' ] [ ASDFGHJKL:" ] 1120 - 1121 - $!a::Send, {U+00E5} ; Small Letter a with Ring Above {U+00E5}: å (Alt+0229) 1122 - $!+a::Send, {U+00C5} ; Capital Letter A with Ring Above {U+00C5}: Å (Alt+0197) 1123 - $!s::Send, {U+00DF} ; German Eszett/beta (Sharfes/Sharp S) {U+00DF}: ß (Alt+0223) 1124 - $!+s::Send, {U+00CD} ; Latin Capital Letter I with Acute {U+00CD}: Í (Alt+0205) 1125 - $!d::Send, {U+2202} ; Partial Differential mathematical symbol {U+2202}: ∂ (Alt+2202) [Needs Unicode] 1126 - $!+d::Send, {U+00CE} ; Latin Capital Letter I with Circumflex {U+00CE}: Î (Alt+0206) 1127 - $!f::Send, {U+0192} ; Function/florin currency symbol {U+0192}: ƒ (Alt+159) 1128 - $!+f::Send, {U+00CF} ; Latin Capital Letter I with Diaeresis {U+00CF}: Ï (Alt+0207) 1129 - 1130 - ; ####################################################################### 1131 - ; ## Problem: Option+g (Win+g) brings up Windows XBox Game Bar! 1132 - ; ## To remove/disable paste this text in PowerShell (without quotes): 1133 - ; ## "Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage" 1134 - ; ####################################################################### 1135 - $!g::Send, {U+00A9} ; Copyright Sign {U+00A9}: © (Alt+0169) 1136 - $!+g::Send, {U+02DD} ; Double Acute Accent diacritic (non-combining) {U+02DD}: ˝ [Needs Unicode] 1137 - $!h::Send, {U+02D9} ; Dot Above diacritic (non-combining) {U+02D9}: ˙ [Needs Unicode] 1138 - $!+h::Send, {U+00D3} ; Latin Capital Letter O with Acute {U+00D3}: Ó (Alt+0211) 1139 - $!j::Send, {U+2206} ; Increment, laplace operator symbol {U+2206}: ∆ [Needs Unicode] 1140 - $!+j::Send, {U+00D4} ; Latin Capital Letter O with Circumflex {U+00D4}: Ô (Alt+0212) 1141 - $!k::Send, {U+02DA} ; Ring Above diacritic (non-combining) {U+02DA}: ˚ [Needs Unicode] (NOT degree sign/symbol) 1142 - 1143 - ; Apple logo {U+F8FF}:  [Unicode Private Use Area, req's Baskerville Old Face font] 1144 - ; $!+k::Send, {U+F8FF} ; This Unicode address only works with Mac fonts 1145 - $!+k:: 1146 - Send, {U+F000} ; Change font of inserted character (may be invisible) to Baskerville Old Face 1147 - apple_logo_alert:=1 ; Set to zero to disable, one to enable (default is enabled) 1148 - if (apple_logo_alert=1) { 1149 - MsgBox, 0, ALERT, % "ALERT: Change the font of the inserted character!`n`n" 1150 - . "Apple logo character requires the Baskerville Old Face font.`n`n`n" 1151 - . "Note 1: The character has been inserted but may be INVISIBLE`n" 1152 - . " (i.e., non-printing) in its current font.`n`n`n" 1153 - . "Note 2: The inserted character will probably NOT be portable`n" 1154 - . " to a Mac document/font. Use only for print/PDF `n" 1155 - . " purposes on PC.`n`n`n" 1156 - . "Note 3: Search for apple_logo_alert in kinto.ahk config and `n" 1157 - . " set it to zero to disable this MsgBox.`n`n`n" 1158 - } 1159 - return 1160 - 1161 - ; ####################################################################### 1162 - ; ## Option+L works, but will also trigger the Win+L screen locking. 1163 - ; ## The screen locking shortcut can only be disabled in the registry. 1164 - ; ####################################################################### 1165 - $!l::Send, {U+00AC} ; Not Sign angled dash symbol {U+00AC}: ¬ (Alt+170) 1166 - $!+l::Send, {U+00D2} ; Latin Capital Letter O with Grave {U+00D2}: Ò (Alt+0210) 1167 - $!;::Send, {U+2026} ; Horizontal elipsis {U+2026}: … (Alt+0133) 1168 - $!+;::Send, {U+00DA} ; Latin Capital Letter U with Acute {U+00DA}: Ú (Alt+0218) 1169 - 1170 - ; ####################################################################### 1171 - ; ## SC028 is single-quote key scan code 1172 - ; ####################################################################### 1173 - $!SC028::Send, {U+00E6} ; Small ae ligature {U+00E6}: æ (Alt+0230) 1174 - $!+SC028::Send, {U+00C6} ; Capital AE ligature {U+00C6}: Æ (Alt+0198) 1175 - 1176 - 1177 - ; ############## 1178 - ; ### 3rd row: Shift-Keys row [ zxcvbnm,./ ] [ ZXCVBNM<>? ] 1179 - 1180 - $!z::Send, {U+03A9} ; Greek Capital Letter Omega symbol {U+03A9} Ω (Alt+234) 1181 - $!+z::Send, {U+00B8} ; Spacing Cedilla diacritic symbol (non-combining) {U+00B8}: ¸ (Alt+0184) 1182 - $!x::Send, {U+2248} ; Almost Equal To symbol (U+2248): ≈ (Alt+247) 1183 - $!+x::Send, {U+02DB} ; Ogonek diacritic (non-combining) (U+02DB): ˛ [Needs Unicode] 1184 - $!c::Send, {U+00E7} ; Small Letter c with Cedilla {U+00E7}: ç (Alt+0231) 1185 - $!+c::Send, {U+00C7} ; Capital Letter C with Cedilla {U+00C7}: Ç (Alt+0199) 1186 - $!v::Send, {U+221A} ; Square Root radical sign (U+221A): √ (Alt+251) 1187 - $!+v::Send, {U+25CA} ; Lozenge (diamond) shape symbol (U+25CA): ◊ [Needs Unicode] 1188 - $!b::Send, {U+222B} ; Integral mathematical symbol (U+222B): ∫ [Needs Unicode] 1189 - $!+b::Send, {U+0131} ; Latin Small Letter Dotless i (U+0131): ı [Needs Unicode] 1190 - 1191 - ; Dead_Keys_Accent_Tilde 1192 - ; Tilde accent: Option+n, then key to accent 1193 - $!n:: 1194 - ; Use Apple "dead keys" Option key method to attach accents to next character typed 1195 - ; Tilde accent activated by Option+n (logical Alt+n) 1196 - StringCaseSense, On 1197 - ; watch next input string 1198 - Input, UserInput, L1 1199 - Switch UserInput { 1200 - Case Esc: Return ; Watch for Escape key, cancel dead keys sequence 1201 - Case "a": Send, {U+00E3} ; ã {U+00E3} (Alt+0227) 1202 - Case "n": Send, {U+00F1} ; ñ {U+00F1} (Alt+0241) 1203 - Case "o": Send, {U+00F5} ; õ {U+00F5} (Alt+0245) 1204 - Case "A": Send, {U+00C3} ; à {U+00C3} (Alt+0195) 1205 - Case "N": Send, {U+00D1} ; Ñ {U+00D1} (Alt+0209) 1206 - Case "O": Send, {U+00D5} ; Õ {U+00D5} (Alt+0213) 1207 - Default: Send, %UserInput% ; No match? Send input through. 1208 - } 1209 - Return 1210 - 1211 - $!+n::Send, {U+02DC} ; Small Tilde character (U+02DC): ˜ (Alt+0152) 1212 - $!m::Send, {U+00B5} ; Micro (mu) symbol {U+00B5}: µ (Alt+0181) 1213 - $!+m::Send, {U+00C2} ; Latin Capital Letter a with Circumflex (U+00C2):  (Alt+0194) 1214 - $!,::Send, {U+2264} ; Less than or equal to symbol {U+2264}: ≤ (Alt+243) 1215 - $!+,::Send, {U+00AF} ; Macron/overline/apl overbar (non-combining) (U+00AF): ¯ (Alt+0175) 1216 - $!.::Send, {U+2265} ; Greater than or equal to symbol {U+2265}: ≥ (Alt+242) 1217 - $!+.::Send, {U+02D8} ; Breve diacritic (non-combining) {U+02D8}: ˘ [Needs Unicode] 1218 - $!/::Send, {U+00F7} ; Obelus/Division symbol {U+00F7}: ÷ (Alt+0247) 1219 - $!+/::Send, {U+00BF} ; Inverted Question Mark {U+00BF}: ¿ (Alt+0191) 1220 - 1221 - #If ; ### END of special character insertion with Option(Alt) key
+449
Documents/AutoHotkey/Default.ahk2
··· 1 + ; @region Autorun 2 + 3 + #SingleInstance force 4 + #Warn All, OutputDebug 5 + 6 + Persistent(true) 7 + KeyHistory(150) 8 + 9 + OnExit(ReleaseModifiers) 10 + 11 + SetNumLockState("AlwaysOn") 12 + SetCapsLockState("AlwaysOff") 13 + 14 + ; Remove the "show desktop" button: https://superuser.com/a/1526926 15 + showDesktopControl := "TrayShowDesktopButtonWClass1" 16 + shellTray := "ahk_class Shell_TrayWnd" 17 + while true { 18 + try { 19 + ControlHide(showDesktopControl, shellTray) 20 + } catch Error { 21 + ; Sometimes it won't exist yet at startup so just wait + try again 22 + Sleep(1000) 23 + } else { 24 + break 25 + } 26 + } 27 + 28 + AHK_NOTIFYICON := 0x404 ; WM_USER + 4 29 + WM_MOUSEFIRST := 0x0200 30 + WM_MOUSEMOVE := 0x0200 31 + WM_LBUTTONDOWN := 0x0201 32 + WM_LBUTTONUP := 0x0202 33 + WM_LBUTTONDBLCLK := 0x0203 34 + WM_RBUTTONDOWN := 0x0204 35 + WM_RBUTTONUP := 0x0205 36 + WM_RBUTTONDBLCLK := 0x0206 37 + WM_MBUTTONDOWN := 0x0207 38 + WM_MBUTTONUP := 0x0208 39 + WM_MBUTTONDBLCLK := 0x0209 40 + WM_MOUSEWHEEL := 0x020A 41 + WM_MOUSEHWHEEL := 0x020E 42 + 43 + ; https://www.autohotkey.com/boards/viewtopic.php?t=9501 44 + OnMessage(AHK_NOTIFYICON, HandleTrayMsg) 45 + ResetMenuItems() 46 + 47 + ; Match title by contains, rather than starts-with 48 + SetTitleMatchMode(2) 49 + 50 + ; @region Groups 51 + 52 + ; Lots of apps I don't use are omitted 53 + GroupAdd("terminal", "ahk_exe powershell.exe") 54 + GroupAdd("terminal", "ahk_exe WindowsTerminal.exe") 55 + GroupAdd("terminal", "ahk_exe Cmd.exe") 56 + 57 + GroupAdd("posix", "ahk_exe WindowsTerminal.exe") 58 + 59 + GroupAdd("ExcPaste", "ahk_exe Cmd.exe") 60 + 61 + GroupAdd("editor", "ahk_exe Code.exe") 62 + 63 + GroupAdd("browser", "ahk_exe chrome.exe") 64 + GroupAdd("browser", "ahk_exe firefox.exe") 65 + GroupAdd("browser", "ahk_exe msedge.exe") 66 + 67 + GroupAdd("vscode", "ahk_exe Code.exe") 68 + 69 + GroupAdd("vstudio", "ahk_exe devenv.exe") 70 + 71 + ; @endregion 72 + 73 + ; @endregion 74 + 75 + ; @region Bindings 76 + 77 + ; NOTE: CapsLock should not be needed with SharpKeys rebind 78 + 79 + ; NOTE: winkey shortcuts can be disabled with https://superuser.com/q/1755857/1228483 80 + 81 + ; @region Kinto-like 82 + 83 + ;; Basic remap 84 + 85 + ; NOTE: SharpKeys handles these remaps, it seems to simplify things: 86 + ; Win->Alt 87 + ; Alt->RCtrl (cmd key) 88 + ; RCtrl->Win ("plain" windows key) 89 + 90 + ; Suppress menubar toggling on release; RAlt can still be used 91 + ~LAlt up::Send("{Blind}{vkFF}") 92 + 93 + ;; word/line navigation support 94 + 95 + ; TODO: file explorer, only when in an edit box 96 + $!Backspace::SendBlind("^{Backspace}") 97 + $!Delete::SendBlind("^{Delete}") 98 + 99 + ; wordwise support 100 + $!Left::SendBlind("^{Left}") 101 + $!+Left::SendBlind("^+{Left}") 102 + $!Right::SendBlind("^{Right}") 103 + $!+Right::SendBlind("^+{Right}") 104 + 105 + ; linewise support 106 + $>^Left::SendBlind("{Home}") 107 + $>^+Left::SendBlind("+{Home}") 108 + $>^Right::SendBlind("{End}") 109 + $>^+Right::SendBlind("+{End}") 110 + ; See below for vscode/terminal version of line deletion 111 + 112 + ;; Virtual desktops/spaces emulation 113 + $<^Left::^#Left 114 + $<^Right::^#Right 115 + $<^Up::#Tab 116 + 117 + ; Mainly used for vscode / terminal "move pane" commands (on macOS, ctrl+cmd+left) 118 + $<^>^Left::^#!Left 119 + $<^>^Right::^#!Right 120 + 121 + ; Maximize / snap 122 + $<^>^+Left::#Left 123 + $<^>^+Right::#Right 124 + $<^>^!Up::WinMaximize("A") ; always maximize unlike Win+Up which toggles 125 + $^>m::WinMinimize("A") 126 + 127 + ; Media keys (ported from BTT) 128 + $<^+Left::Media_Prev 129 + $<^+Right::Media_Next 130 + $<^+Space::Media_Play_Pause 131 + 132 + ; Spotify volume might be doable with 133 + ; https://gist.github.com/jcsteh/7ccbc6f7b1b7eb85c1c14ac5e0d65195 134 + ; Like Song too although I could probably also reuse like_spotify_song.py 135 + 136 + ; return 137 + !Enter:: 138 + { 139 + if (GetKeyState("RAlt", "P")) { 140 + Send("{Insert}") 141 + } 142 + else { 143 + Send("{Alt down}{Enter}{Alt up}") 144 + } 145 + } 146 + 147 + ; Close Apps 148 + ^q::Send("!{F4}") 149 + 150 + ; Spotlight emulation (PowerToys Run) 151 + $>^Space::!Space 152 + 153 + ; Task manager (like force quit dialog) 154 + ^!Esc::^+Esc 155 + 156 + ;; AltTab fixes 157 + 158 + ; for window-switcher, to avoid e.g. terminal in vscode 159 + $>^`::!` 160 + 161 + $>^Tab::{ 162 + ; It would be nice to use plain AltTab here, but there's apparently no way to 163 + ; make it so ^+Tab invokes ShiftAltTab. So manually implemented here we go: 164 + Send("{Alt down}{Tab}") 165 + ; For some reason, this can leave alt down when ctrl is released very quickly. 166 + ; It seems like maybe a KeyWait issue, but idk? 167 + KeyWait("RCtrl") 168 + Send("{Alt up}") 169 + } 170 + 171 + ; Random keybind that I rarely use except Stretchly, but it opens the start menu 172 + ; so just binding to avoid any surprises from that. 173 + >^Esc::#Esc 174 + 175 + ;; #HotIf directives 176 + ; NOTE: All shortcuts after this point take precedence over global shortcuts above 177 + 178 + ; For some reason these are taking precedence over more-specific #HotIf 179 + ; so just manually disabling for vscode/terminal 180 + #HotIf not WinActive("ahk_group vscode") and not WInActive("ahk_group terminal") 181 + $^Backspace::SendBlind("+{Home}{Backspace}") 182 + $^Delete::SendBlind("+{End}{Delete}") 183 + #HotIf 184 + 185 + #HotIf WinActive("ahk_class MultitaskingViewFrame") 186 + ; not sure why this is needed but it makes things work properly... 187 + $~RCtrl up::{ 188 + Send("{Blind!^}{LAlt up}") 189 + } 190 + 191 + ; Release alt if cancelled or finished 192 + ~*Esc::Send("{Blind}{Alt up}") 193 + ~*MButton::Send("{Blind}{Alt up}") 194 + ~*Enter::Send("{Blind}{Alt up}") 195 + #HotIf 196 + 197 + #HotIf MouseIsOverTaskbarApp() 198 + ; Make clicking apps in the taskbar more like macOS. Individual windows can 199 + ; still be selected by just hovering, then clicking. Is this the best way to 200 + ; deal with this? idk, but it seems to work, sometimes... 201 + 202 + ; A simple LButton::^LButton seemed not to work how I expected but this does: 203 + LButton::{ 204 + if KeyWait("LButton", "T0.2") { 205 + SendBlind("^{LButton}") 206 + } else { 207 + ; handle drag without sending ctrl 208 + SendBlind("{LButton down}") 209 + KeyWait("LButton") 210 + SendBlind("{LButton up}") 211 + } 212 + } 213 + #HotIf 214 + 215 + ; @endregion 216 + 217 + ; @region Per-app 218 + 219 + ;; File explorer 220 + ; TODO maybe also do some of these for ahk_class #32770 (file dialog) 221 + #HotIf WinActive("ahk_class CabinetWClass ahk_exe explorer.exe") 222 + ^i::Send("!{Enter}") ; Cmd+i: Get Info / Properties 223 + ^r::Send("{F5}") ; Cmd+R: Refresh view (Not actually a Finder shortcut? But works in Linux file browsers too.) 224 + ^1::Send("^+2") ; Cmd+1: View as Icons 225 + ^2::Send("^+6") ; Cmd+2: View as List (Detailed) 226 + ^3::Send("^+5") ; Cmd+3: View as List (Compact) 227 + ^4::Send("^+1") ; Cmd+4: View as Gallery 228 + ^Up::Send("!{Up}") ; Cmd+Up: Up to parent folder 229 + ^Left::Send("!{Left}") ; Cmd+Left: Go to prior location in history 230 + ^Right::Send("!{Right}") ; Cmd+Right: Go to next location in history 231 + ^Down::{ 232 + ; Cmd-Down: Navigate into the selected directory 233 + for window in ComObject("Shell.Application").Windows 234 + if WinActive() = window.hwnd 235 + for item in window.document.SelectedItems { 236 + window.Navigate(item.Path) 237 + return 238 + } 239 + } 240 + ^[::Send("!{Left}") ; Cmd+Left_Brace: Go to prior location in history 241 + ^]::Send("!{Right}") ; Cmd+Right_Brace: Go to next location in history 242 + ^+o::Send("^{Enter}") ; Cmd+Shift+o: Open in new window (tabs not available) 243 + $>^Delete::Send("{Delete}") ; Cmd+Delete: Delete / Send to Trash 244 + $>^Backspace::Send("{Delete}") ; Cmd+backspace: Delete / Send to Trash 245 + ^d::return ; Block the unusual Explorer "delete" shortcut of Ctrl+D, used for "bookmark" in similar apps 246 + 247 + ; Use Enter key to rename (F2), unless focus is inside a text input field. 248 + $Enter::{ 249 + fc := ControlGetClassNN(ControlGetFocus("A")) 250 + if (fc ~= "i)(Edit|Search|Notify|Windows\.UI\.Core\.CoreWindow1|SysTreeView321)") 251 + Send("{Enter}") 252 + else 253 + Send("{F2}") 254 + } 255 + ; TODO: make these play nice with e.g. linewise delete 256 + ; $BackSpace::{ 257 + ; ; Backspace (without Cmd): Block Backspace key with error beep, unless inside text input field 258 + ; fc := ControlGetClassNN(ControlGetFocus("A")) 259 + ; if NOT (fc ~= "i)(Edit|Search|Notify|Windows\.UI\.Core\.CoreWindow1)") 260 + ; Send("{BackSpace}") 261 + ; else 262 + ; Bell() 263 + ; } 264 + ; $Delete::{ 265 + ; ; Delete (without Cmd): Block Delete key with error beep, unless inside text input field 266 + ; fc := ControlGetClassNN(ControlGetFocus("A")) 267 + ; if (fc ~= "i)(Edit|Search|Notify|Windows\.UI\.Core\.CoreWindow1)") 268 + ; Send("{Delete}") 269 + ; else 270 + ; Bell() 271 + ; } 272 + 273 + Tab::{ 274 + ; Auto-completion - move to the next suggestion when in a text box 275 + fc := ControlGetClassNN(ControlGetFocus("A")) 276 + if (fc ~= "i)(Edit|Search)") 277 + Send("{Down}") 278 + else { 279 + Send("{Tab}") 280 + } 281 + } 282 + 283 + ; PowerToys Peek (like Quick Look) 284 + Space::^Space 285 + 286 + #HotIf 287 + 288 + #HotIf WinActive("ahk_exe PowerToys.Peek.UI.exe") 289 + Space::^Space 290 + #HotIf 291 + 292 + ;; VSCode 293 + #HotIf WinActive("ahk_group vscode") 294 + ; Send meta key instead of ctrl for commonly used shortcuts that I've already bound in macOS 295 + ; Most require modifier(s) to be recognized by vscode instead of intercepted by windows 296 + 297 + ; Basic completion/code actions 298 + $!Space::^Space 299 + $>^.::^. 300 + 301 + ; Reveal in sidebar 302 + $<^>^r::^#r 303 + 304 + ; find + replace 305 + $>^f::^#f 306 + $>^r::^!#r 307 + 308 + ; toggle regex search (needed to undo above ^r binding) 309 + ; although apparently alt+r by itself is enough... let's use that 310 + $>^!r::^!r 311 + 312 + ; copy + paste 313 + $>^c::#!c 314 + $>^v::#!v 315 + 316 + ; focus comments view (needed to undo above ^c binding) 317 + $>^+c::^+c 318 + 319 + ; set file language 320 + $>^l::^!l 321 + ; change indent size 322 + $>^+l::^+l 323 + 324 + ; Go to symbol in workspace 325 + $<^>^p::^!p 326 + #HotIf 327 + 328 + ;; Terminals 329 + #HotIf WinActive("ahk_group vscode") OR WinActive("ahk_group terminal") 330 + ; linewise deletion supported by readline/in-app bindings 331 + $>^Backspace::^+Backspace 332 + $>^Delete::^+Delete 333 + #HotIf 334 + 335 + ;; Browsers 336 + #HotIf WinActive("ahk_group browser") 337 + #HotIf 338 + 339 + ;; Slack 340 + #HotIf WinActive("ahk_exe Slack.exe") 341 + ; History navigation 342 + ^[::!Left 343 + ^]::!Right 344 + #HotIf 345 + 346 + ;; KeepassXC 347 + #HotIf WinActive("ahk_exe KeePassXC.exe") 348 + #HotIf 349 + 350 + ; @endregion 351 + 352 + ; @endregion 353 + 354 + ; @region Helpers 355 + 356 + Exit() { 357 + ReleaseModifiers() 358 + ExitApp() 359 + } 360 + 361 + ReloadScript() { 362 + ReleaseModifiers() 363 + Sleep(100) 364 + Reload() 365 + ; See help for reload 366 + Sleep(1000) 367 + ; MsgBox,,, The script could not be reloaded. 368 + return 369 + } 370 + 371 + ReleaseModifiers(args*) { 372 + for Each, Modifier in [ 373 + "LShift", 374 + "RShift", 375 + "LControl", 376 + "RControl", 377 + "LWin", 378 + "RWin", 379 + "LAlt", 380 + "RAlt", 381 + ] 382 + if GetKeyState(Modifier) And !GetKeyState(Modifier, "P") 383 + Send("{" Modifier " Up}") 384 + } 385 + 386 + /** 387 + * @description Sends a key sequence with {Blind!#^+} to suppress all modifiers 388 + * but retain other Blind functionality e.g. held modifiers 389 + */ 390 + SendBlind(keys) { 391 + Send("{Blind!#^+}" . keys) 392 + } 393 + 394 + Bell() { 395 + SoundPlay(A_WinDir "\Media\Windows Ding.wav") 396 + } 397 + 398 + MouseIsOverTaskbarApp() { 399 + ListLines(false) 400 + winID := -1 401 + hoveredControl := "" 402 + try { 403 + MouseGetPos(, , &winID, &hoveredControl) 404 + } catch { 405 + ; this randomly happens sometimes idk, maybe a bug 406 + return false 407 + } 408 + 409 + exists := WinExist(shellTray . " ahk_id " . winID) 410 + matches := hoveredControl == "MSTaskListWClass1" 411 + ListLines(true) 412 + return exists and matches 413 + } 414 + 415 + HandleTrayMsg(wParam, lParam, msg, hwnd) { 416 + ListLines(false) 417 + if (lParam == WM_RBUTTONUP) { 418 + ResetMenuItems() 419 + if (GetKeyState("Shift", "P")) { 420 + A_TrayMenu.Add() 421 + A_TrayMenu.AddStandard() 422 + A_TrayMenu.Delete("E&xit") ; remove the builtin exit in favor of custom 423 + } 424 + ; We don't need to Show() the menu here, since that's the default action 425 + ; Unclear if there's a way to suppress that but this works for now 426 + } 427 + ListLines(true) 428 + } 429 + 430 + ResetMenuItems() { 431 + A_TrayMenu.Delete() 432 + 433 + A_TrayMenu.Add("Reload", (args*) => ReloadScript()) 434 + A_TrayMenu.Add("History", (args*) => KeyHistory()) 435 + A_TrayMenu.Add("Exit", (args*) => Exit()) 436 + 437 + A_TrayMenu.Default := "Reload" 438 + } 439 + 440 + IsControlKindActive(className) { 441 + FocusedHwnd := ControlGetFocus("A") 442 + try { 443 + return className == WinGetClass(FocusedHwnd) 444 + } catch Error { 445 + return false 446 + } 447 + } 448 + 449 + ; @endregion