Windows 10: Change shortcut keys to switch between desktops [duplicate]

In Windows 10, the shortcut keys for switching virtual desktop are ctrl + win + right / left arrow. I'd like to simplify it, by changing it to ctrl + right or left arrow key only. How can I do this?


Solution 1:

AutoHotkey is a great program for doing this exact type of thing. It is an very useful program for remapping keyboard keys, letting you set up hotkeys, and automating tasks. Here are the steps to set this up:

  1. Download AutoHotkey (http://www.autohotkey.com/) and install it.
  2. Right-click on your desktop > New > Autohotkey Script (name it whatever you want).
  3. Right-click, Edit Script.
  4. Paste the following text under the already-present text:

#NoTrayIcon ^Right::^#Right ^Left::^#Left

  1. Save and run the script to test its functionality.
  2. If it performs as expected, copy the script into the startup folder* so that it will run every time your computer starts.

Optionally, you can compile the script to run as a standalone .exe that can be run on other computers that don't have AutoHotkey installed. To do this, right-click the script file, and click "Compile Script."

*To access the startup folder in Windows 10, open "Run" (either press Windows Key + R, or search for it in the start menu) and type either (without quotes): "shell:startup" (to run the script for just the current user) or "shell:common startup" (to run it for all users). Paste it in the folder that opens.

Solution 2:

To respond @valkirilov's comment under ElectroPulse's answer, I see this post is helpful. Remapping Ctrl-Alt-Arrow in Windows 10 using AutoHotkey

In short, using

!^Right:: send {LWin down}{LCtrl down}{Right}{LWin up}{LCtrl up}
!^Left:: send {LWin down}{LCtrl down}{Left}{LWin up}{LCtrl up}

Solution 3:

I created some shortcuts for switching between desktops. I wanted a 3x3 grid of desktops (virtually, or in my mind-map only--in reality they are linear). I wanted the number pad keys to map to each desktop respectively.

The way the hotkeys work is by

  • assuming there are 9 desktops total
  • scrolling at least 9 to the left/right to ensure we're at a linear edge of known desktops
  • scrolling back the right number to get where I want.

Since there is no easy way to move a window to a specific desktop, I used Win+Numpad0 to bring up the "move to desktop" menu for that window. It's a compromise I have little hope of resolving soon (but I did post my own question about it).

Here are my shortcuts:

; Windows+Number pad keys = Windows 10 desktop switching.
; number pad to match a 3x3 desktop
#Numpad1::
#NumpadEnd::
    Send, {LWin down}{Ctrl down}{Right 9}{Left 2}{Ctrl up}{LWin up}
    return
#Numpad2::
#NumpadDown::
    Send, {LWin down}{Ctrl down}{Right 9}{Left 1}{Ctrl up}{LWin up}
    return
#Numpad3::
#NumpadPgDn::
    Send, {LWin down}{Ctrl down}{Right 9}{Ctrl up}{LWin up}
    return
#Numpad4::
#NumpadLeft::
    Send, {LWin down}{Ctrl down}{Left 9}{Right 3}{Ctrl up}{LWin up}
    return
#Numpad5::
#NumpadClear::
    Send, {LWin down}{Ctrl down}{Left 9}{Right 4}{Ctrl up}{LWin up}
    return
#Numpad6::
#NumpadRight::
    Send, {LWin down}{Ctrl down}{Right 9}{Left 3}{Ctrl up}{LWin up}
    return
#Numpad7::
#NumpadHome::
    Send, {LWin down}{Ctrl down}{Left 9}{Ctrl up}{LWin up}
    return
#Numpad8::
#NumpadUp::
    Send, {LWin down}{Ctrl down}{Left 9}{Right 1}{Ctrl up}{LWin up}
    return
#Numpad9::
#NumpadPgUp::
    Send, {LWin down}{Ctrl down}{Left 9}{Right 2}{Ctrl up}{LWin up}
    return
;   Send, {LWin down}{Tab}{LWin up}
;   Sleep, 3000
;   Send, {Tab 1}{Right 2}
;   Sleep, 3000
;   Send, {Enter}
;   Sleep, 3000
;   return
;
;   Bring up the "move this window to desktop..." menu.  Since the menu is always different, don't operate on it.  Just leave it at that.
#!Numpad0::
#!NumpadIns::
#+Numpad0::
#+NumpadIns::
#Numpad0::
#NumpadIns::
    Send, {LWin down}{Tab}{LWin up}
    Sleep, 400
    Send, {AppsKey}M
return