AutoHotkey scripts for Windows 11 virtual desktop and window management.
Switch between and manage Windows 11 virtual desktops using keyboard shortcuts.
Requires VirtualDesktopAccessor.dll — download the latest x64 release from:
github.com/Ciantic/VirtualDesktopAccessor/releases
Place the .dll in the same folder as VD.ahk.
| Hotkey | Action |
|---|---|
Win + 1-5 |
Switch to desktop 1–5 |
Win + Shift + 1-5 |
Move active window to desktop 1–5 |
Win + Shift + P |
Toggle pin window to all desktops |
**Move behavior:** By default, moving a window will follow it to the destination desktop. To stay on the current desktop instead, comment out the
GoToDesktopNumberline inside theMoveTo()function.
Window dragging and resizing — click anywhere in a window, no title bar needed.
| Hotkey | Action |
|---|---|
Alt + Left-drag |
Move window |
Alt + Right-drag |
Resize window (quadrant-aware) |
RButton + Left-drag |
Move window (desktop style) |
**Resize behavior:** The corner that gets resized depends on which quadrant of the window you click in. Clicking the top-left resizes from the bottom-right, and so on. Minimum window size is capped at 100×50px.
Automatically minimizes the previous window when using Alt-Tab, keeping your desktop clean.
| Hotkey | Action |
|---|---|
Alt + Tab |
Switch windows and minimize the previous active window |
Quickly open the PowerToys Command Palette by remapping the Windows key.
| Hotkey | Action |
|---|---|
Windows Key |
Open PowerToys Command Palette (Alt + Space) |
**Customization:** To use a different key, change
*~LWin::in the script to your preferred key (e.g.,*~LAlt::for Left Alt,*~Capslock::for Caps Lock). To open a different app or shortcut instead of the Command Palette, change theSend "!{Space}"line to send the appropriate keystrokes for your desired action.
- Install AutoHotkey v2
- Clone or download this repo
- For Virtual Desktops, download
VirtualDesktopAccessor.dll(see above) - Double-click any
.ahkfile to run it, and add it to your startup folder:%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup