An AutoHotkey script for Windows that lets a user switch virtual desktops by pressing CapsLock and a number row key at the sime time (e.g. CapsLock + 2 to switch to Desktop 2). It also provides other features, such as customizing the key combinations, creation/deletion of desktops by hotkey, etc. (see Hotkeys section below).
Action | Keys |
---|---|
Switch to virtual desktop 1, 2, etc. (you can also use the Numpad) |
CapsLock + 1 CapsLock + 2 ... CapsLock + 0 |
Current virtual desktop ID 1 - 10 to the last desktop used | CapsLock + ` |
Move the current window to another desktop, then switch to it Keys Q, W, etc. correspond to 1st, 2nd, etc. desktops |
CapsLock + Q CapsLock + W ... CapsLock + P |
Home, End, Page Up, Page Down, Del | CapsLock + ← CapsLock + → CapsLock + ↑ CapsLock + ↓ CapsLock + backspace |
You can also customize the hotkeys and actions as described in the section below.
This script creates more convenient hotkeys for switching virtual desktops in Windows 11 and solve FN left right arrows form DELL XPS 9700. Capslock is sacrificed
Install AutoHotkey v1.1 or later, then run the desktop_switcher.ahk
script (open with AutoHotkey if prompted). You can disable the switching animation by opening "Adjust the appearance and performance of Windows" and then unselecting the checkmark "Animate windows when minimizing and maximizing".
A more detailed description of hotkeys can be found here: AutoHotkey docs.
- Thanks to Ciantic/VirtualDesktopAccessor (DLL) and sdias/win-10-virtual-desktop-enhancer (DLL usage samples), our code can now move windows between desktops.