Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 2.43 KB

File metadata and controls

50 lines (41 loc) · 2.43 KB

HyperKey PowerToys CommandPallete Extension

We are working on a PowerToys CommandPallete Extension. Documentation is located at: https://learn.microsoft.com/en-us/windows/powertoys/command-palette/extension-development This documentation details the architecture and API reference for extension development.

HyperKey Functionality

  • Target: Create a "HyperKey" functionality using CapsLock (default, but configurable) as a common modifier.
  • Goal: Hold HyperKey and activate another command.
  • Default Emulation: Emulate the holding of SHIFT + LEFTCTRL + WIN + ALT.
  • Interaction Example: If there is another shortcut like SHIFT + LEFTCTRL + WIN + ALT + C, holding HyperKey + C should trigger the same shortcut/command.
  • Default implementation targets the CapsLock key.

Rules

  • When the user holds CapsLock, simulate the hold of SHIFT + LEFTCTRL + WIN + ALT.
  • When the user releases CapsLock, simulate the release of SHIFT + LEFTCTRL + WIN + ALT.
  • If the user taps CapsLock quickly (default 300 ms, configurable later), simply toggle/activate CapsLock (do not simulate the hold of other keys).
  • Maintain and update the root README.md whenever new features, configurations, or commands are introduced to keep the user-facing documentation in sync with the codebase.
  • Never run the application directly as it is a PowerToys Command Palette extension (and runs as a packaged WinRT COM out-of-process server). Only compile the solution to validate for compiler errors and warnings, and let the user deploy/install it from Visual Studio.

Reference Implementations

AutoHotkey Example:

#Requires AutoHotkey v2.0

*CapsLock::
{
    startTime := A_TickCount
    Send("{Ctrl down}{Shift down}{Alt down}{LWin down}")
    KeyWait("CapsLock")
    Send("{Ctrl up}{Shift up}{Alt up}{LWin up}")
    
    if (A_TickCount - startTime < 200) && (A_PriorKey = "CapsLock")
    {
        SetCapsLockState(!GetKeyState("CapsLock", "T"))
    }
}

Raycast Hyper Key Configuration:

  • Hyper Key: Caps Lock (⇧)
    • Pressing Caps Lock (⇧) will trigger the left Ctrl+Alt+Shift+Win modifier keys. Hyper Key shortcuts will be shown with ✦.
  • Quick Press: Trigger Caps Lock (⇧)
    • Action to perform when Caps Lock (⇧) is pressed without any other keys.
  • Include Shift (⇧): Enabled (toggled on).

Target Command

  • Create a single command called "Activate HyperKey" in the Command Palette extension that enables this functionality.