microsoft / microsoft/PowerToys

New utility proposal: Macro — keyboard macro recorder with hotkey-triggered step sequences

Open
#47,614 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Product-Settings
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

Description of the new feature / enhancement

Add a Macro utility to PowerToys that lets users record and replay keyboard sequences triggered by a configurable hotkey. Each macro is a named, ordered list of steps that executes automatically when the hotkey fires.

Scenario when this would be used?

  • Automation of repetitive text entry: a developer presses Ctrl+F9 and a boilerplate comment block is typed into the editor
  • Application-scoped shortcuts: a macro scoped to notepad.exe that formats text differently than the same hotkey in another app
  • Multi-step keyboard sequences: open a terminal, navigate to a project folder, and run a build command — all from a single hotkey
  • Accessibility: users with repetitive strain injury can replace multi-key sequences with a single hotkey
  • Testing and QA: quickly replay a fixed input sequence to reproduce a bug

Supporting information

Fit with PowerToys philosophy:
Macro is a direct complement to Keyboard Manager — KBM remaps individual keys, Macro executes sequences. Both are power-user keyboard utilities. AutoHotkey, Macro Recorder, and similar tools have large Windows user bases, and the existing Automation for PowerToys request (#36941) has significant community interest.

Proposed implementation:

Three projects added under src/modules/Macro/:

Project Purpose
MacroCommon Shared models + AOT-compatible JSON serializer
MacroEngine Background host: hotkey registration (RegisterHotKey), step execution (SendInput), named-pipe IPC
MacroModuleInterface C++ Runner integration (PowertoyModuleIface)

Step types: PressKey, TypeText, Wait, Repeat (with nested steps).

Macro definition stored at %APPDATA%\Microsoft\PowerToys\Macro\macros.json — hot-reloaded on change via FileSystemWatcher.

Settings UI additions: MacroPage (list with enable toggles, edit, delete) and MacroEditDialog (name, hotkey, app scope, step-tree editor) integrated into the existing Settings app with full MVVM layer.

Working prototype: A prototype implementation exists with 197 passing unit tests covering serialization, hotkey parsing, step execution, app-scope checking, and all UI view models. Screenshots:

Macro page
Edit dialog

Known limitations / future work:

  • No macro recorder (manual step entry only for v1)
  • No condition-based branching yet (planned for follow-up)
  • No import/export
  • App scope matches by process name only (no window title filtering)

I would like to contribute this feature. I have read CONTRIBUTING.md and commented on the contributor thread. Happy to discuss the approach, write a formal spec, or adjust the scope based on team feedback before proceeding.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CONTRIBUTING.md and the existing Keyboard Manager integration, then review the proposed projects under src/modules/Macro/, especially MacroCommon, MacroEngine, and MacroModuleInterface. Check the prototype’s 197 unit tests and the proposed MacroPage and MacroEditDialog scope. Done means agreeing on the feature scope and architecture before implementing the utility and its Settings integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.