A PowerToys Command Palette extension that adds HyperKey functionality to Windows. It allows you to use your CapsLock key as a powerful modifier key that simulates holding down Ctrl + Shift + Alt + Win.
- HyperKey Modifier: Hold the configured modifier key and press any other key to trigger shortcuts bound to the remapped chord.
- Customizable Modifier Key: Choose the activation key from standard options like
Caps Lock,Left/Right Ctrl,Left/Right Shift,Left/Right Alt,Left/Right Win, function keysF1throughF12, orNone(effectively disabled). - Include Shift Key Option: Toggle whether the simulated modifier chord includes the
Shiftkey. - Quick Press (Original Function): Press and release the modifier key quickly (within 300 ms) to toggle or trigger its original function (e.g., toggling capitalization lock for Caps Lock, or sending a standard keypress for other keys).
- Dynamic Command Palette Toggle: A single "Activate/Deactivate HyperKey" command within the PowerToys Command Palette manages the hook.
- Isolated Hook Process: Runs in a dedicated background STA thread within the extension COM out-of-process server, keeping the PowerToys process clean and responsive.
- Zero Orphaned Hooks: The keyboard hook is automatically unregistered upon extension disposal or unloading.
You can configure HyperKey settings directly within the PowerToys Command Palette extension settings manager:
- Modifier Key: Choose which key acts as the HyperKey.
- Options include:
None(effectively disabled),Caps Lock (⇪)(default), standard modifiers (Ctrl, Shift, Alt, Win for left/right keys), and function keys (F1throughF12). - Fallback: If settings are empty,
Caps Lockis selected.
- Options include:
- Include shift key: Toggles whether the simulated modifier chord includes the
Shiftkey (emulatesCtrl + Shift + Alt + Winwhen enabled, orCtrl + Alt + Winwhen disabled).- Default: Enabled (
true).
- Default: Enabled (
The extension is built on top of the Microsoft Command Palette Extensions SDK and runs as an out-of-process WinRT COM server.
┌─────────────────────────────────┐
│ PowerToys Command Palette │
└────────────────┬────────────────┘
│ (WinRT COM IPC)
┌────────────────▼────────────────┐
│ HyperKey COM Server Process │
│ ┌───────────────────────────┐ │
│ │ Extension Page & UI │ │
│ └───────────────────────────┘ │
│ ┌───────────────────────────┐ │
│ │ HyperKey Hook Thread │ │
│ │ - WH_KEYBOARD_LL │ │
│ │ - STA Message Pump │ │
│ └───────────────────────────┘ │
└─────────────────────────────────┘
- Activation: When "Activate HyperKey" is invoked, the extension starts a dedicated background thread configured with a Win32 message loop (
GetMessage) and registers a low-level keyboard hook. - Press Interception: When
CapsLockis pressed down, the hook swallows the keypress, records the start time, and usesSendInputto simulate key downs forLeft Ctrl,Left Shift,Left Win, andLeft Alt. - Release Interception: When
CapsLockis released, the hook releases the simulated modifier keys. If the press duration was under 300 ms and no other keys were pressed, a simulated Caps Lock key cycle (down/up) is sent to toggle standard capitalization lock. - Recursion Prevention: Simulated keystrokes sent by the extension are flagged with a unique signature in
dwExtraInfo. The hook intercepts these and passes them along directly to avoid recursive loops.
- Windows 10 or 11
- .NET 10 SDK
- PowerToys (with Command Palette enabled)
- Open the solution in Visual Studio or your preferred C# IDE, or use the .NET CLI:
dotnet build
- To compile and generate MSIX packages for publish/sideloading (both
x64andARM64configurations), run the provided PowerShell script from the root folder:.\buildForPublish.ps1
- Build and deploy the project. (To register the COM server, ensure the MSIX package is deployed or run in development mode).
- Open the Command Palette in PowerToys.
- Search for and select "Reload Command Palette extensions".
- Locate the "HyperKey for CommandPallete" page to activate the hook.