Windows: Key Sequences and Macros

Windows: Key Sequences and Macros

Remap Keys One-To-One

This is no longer relevant because Windows has this almost built in thanks to the PowerToys “Keyboard Manager”.

The previous solution was randyrants/sharpkeys which managed a Registry keys to remap one key to any other key. There is also the Microsoft Keyboard Layout Creator (MSKLC) where you could create a completely new layout file.

But all of that is now unnecessary and you can just use the Keyboard Manager from PowerToys.

Key Sequences

remap key sequences, text expander, text substitution tool, text snippet tool, remap multi-key sequences to individual keys

I think key sequences can be done with any automation tool, but there are also tools that are just for this purpose and aren’t as bulky as macro tools. These tools are also often used for entering accents in “weird” alphabets.


Espanso is cross-platform and open-source and it’s written in Rust. Installing it is super easy with scoop install espanso. There are tons of Espanso add-ons available on Espanso Hub. It supports a lot of things, like app-specific configurations and Synchronization is properly documented.

I ran espansod env-path register to add espanso to the PATH, but it didn’t work, even after opening a new terminal. Later, I realized that espanso was never in the path when I opened the terminal as an Administrator, but it was there from the start when I opened it as a user.

You’ll find that the file espanso.cmd is just a wrapper that calls espansod.exe without any changes. Since espansod was already in my path, I’ll keep using it. You can use the command espansod path to get the important folders, for example a path to the configuration file.

So far Espanso was working great everywhere, except in applications with elevated privileges.

Other Utilities

  • Beeftext | xmichelo/Beeftext is a great text snippet tool

  • Macro Recorder is more for automation, but it’s so basic I’m putting it here

  • Key Manager is a relatively classic key remapper

  • WinCompose | samhocevar/wincompose was the tool I used to use and it can be installed with scoop install wincompose. I’m now switching to Espanso as there was something weird with the Wincompose installation with Scoop.

  • Quick Accent PowerToys utility is one way to enter accent characters

  • WizKey is a tool for typing accented and Unicode characters in a slightly different way, but there’s not even a free version of it

Windows Automation Tools

scripting utility, macro recording

Windows Automation Tools

AutoHotkey | AutoHotkey/AutoHotkey is an open-source legend and is used for all kinds of things on your computer. Think of it as an ultimate macro-creation and automation-oriented scripting utility for Windows.

  • AutoIt scripting language is a serious competitor to AutoHotkey, though still less popular

  • TinyTask is one of the alternatives that, even if it’s better, has a hard time competing against the already established and free players.

Tools to Learn and Practice App Shortcuts

I’m assuming there are plenty of these, but I haven’t explored this topic much.

  • KeyCombiner is a great online tool for organizing and practicung shortcuts and it’s mostly free.There’s a desktop app too, but there’s no need for it for the most part.

Developers have a real problem with QUERTZ Layout in German or Serbian.

The current official layout for Serbian is QWERTZ and there’s a layout image in that article. However, when it’s used in developer tools, the same problem exists with Germany and any other country that use the QWERTZ layout.

Everyone should definitely check out Why Keyboard Shortcuts don’t work on non-US Layouts and the comments on Hacker News.

The Keyboard Event Viewer which is mentioned in above sources is really useful as it is neat little online tool that shows which button presses produce which event properties.

Some sensible solutions have been proposed here: Can I make Ctrl+Alt NOT act like AltGr on Windows? and one of them is to press LCtrl+LAlt to activate English layout just temporarily thus avoiding part of the problem. That I read in this discussion: Option to disable Ctrl+Alt = AltGr.

Particularly, this comment suggested using the tool BladeMight/Mahou which in turn is all in proper Russian and terrible English and which apparently serves for some instant alphabet transliteration or something similar?

Either way, this user hints at the option to open Mahou’s “Layouts” tab and in the “Temporary change layout on LCtrl+LAlt combination” field enter value 67699721 as that’s the English US code, and then click on the “Apply” button.

I tried that and didn’t get much out of it!

Let’s Invent a New Layout

None of the solutions is ideal. A radical approach would be to use a completely new keyboard layout, something like the Dvorak layout for the US layout, and that’s what the following authors are doing for the EU or German layouts:

  • EurKEY aka “The European Keyboard Layout” is a custom remap layout that covers all European languages

  • Neo is an ergonomically optimized new German layout, but it’s all the same idea as others

  • bradrn/Conkey is also a new keyboard layout and the author says it’s for “conlangers”. I don’t know what that means, but I think it’s for languages with accent letters

  • Even our neighbors have some of their own solutions that theoretically I can also use ivancuric/mac-hr-sane-layout, but somehow it didn’t feel proper

  • Keyman is a free and open source keyboarding platform to define layouts, but it seems too bulky and corporate for me, so forget about it

Windows Automation

Autohotkey / Automation

Autohotkey / Automation

AHK libraries & notable scripts: :: camerb/AHKs :: MasterFocus/AutoHotkey · GitHub :: TF: Textfile & String Library for AutoHotkey [lib] :: AutoHotkey - TotalcmdWiki :: Script Listing - AutoHotkey :: iSwitchw - cosmetically enhanced edition • AutoHotkey Community :: Time-Saving AutoHotKey Scripts - TechSpot Guides Help on writing scripts: :: Alphabetical Command List for AutoHotkey :: AHKs/IntelliSense.ahk at master · camerb/AHKs · GitHub :: Windows Programing: AutoHotkey Tutorial :: How to Make Your Computer Press a Key

Interesting ideas

Snow SMS alert :: Automated snow SMS alert « The New Hobbyist

Copy-Paste without formatting

AHK to simulate Copy-Paste, but without formatting: $^v:: ClipSaved := ClipboardAll ;save original clipboard contents clipboard = %clipboard% ;remove formatting Send ^v ;send the Ctrl+V command Clipboard := ClipSaved ;restore the original clipboard contents ClipSaved = ;clear the variable Return $^+v:: Send ^v ;just send the regular paste command Return Source: :: Better Paste Takes the Annoyance

AHK Scripts with Evernote :: Getting Things Done :: Quick AutoHotKey hack to format text :: Quick Evernote search

Applied scripts on my system

Copy Evernote Note URL Link :: Quick Copy Evernote Note Links - Home Reload current script on Ctrl-Alt-R and include it with every other script :: Reloading AutoHotKey Scripts :: Managing AutoHotKey Scripts - Home - Thought Asylum

Belevedere Script :: Belvedere Automates Your Self-Cleaning PC :: mshorts/belvedere · GitHub

Search & replace clipboard for passwords

I made a small Autohotkey script to do exactly that. Replacements are stored in a file in the same directory as AHK script.

Machine: Linux user: / Root user: root / Database: , , /

date 31. Jan 2023 | modified 03. Feb 2023
filename: Windows » Remap Keys, Text Expanders, Macro Automation