Switch desktop Windows 10 shortcut

Virtual Desktops on Windows 11/10 are widely used by people to group and decentralize their computer deskwork. The application allows you to run more than one desktop interface on a single computer, for you to be able to manage multiple tasks at the same time on a single computer setup.

It is very easy to create a virtual desktop and group together related browser windows, and once you get the hang of it, it really gives a boost to your productivity. Managing multiple workflows will not seem as tedious a task as it used to. The one complaint people have had with this feature is its uncomfortable keyboard shortcut. The default keyboard shortcut to switch between virtual desktops is Ctrl + WinKey + Left or the Right Arrow key.

The problem with this shortcut key is that it requires you to use both your hands, which makes it unintuitive and not something that people generally prefer. Lucky for you, Windows allows you to make changes to almost everything it has to offer, including the keyboard shortcut to switch between virtual desktops. So today, we will be showing you how you can change the keyboard shortcut for Virtual Desktop on Windows 11/10. This process will show you how you can change the shortcut keys to switch between virtual desktops using AutoHotKey.

Change Virtual Desktop shortcut in Windows 11/10

The process that you have to follow is very simple and takes just a couple of minutes. Since there isn’t a built-in setting to modify the keyboard shortcut of this utility, you will have to download and install AutoHotKey. Follow the steps below after the installation is complete.

Visit your desktop screen, right-click on an empty section of the desktop, and from the New options that appear, create a text document.

Name this file ‘Change VD shortcut.ahk’. You can name the document whatever you want but you just have to make sure that the file extension is .ahk [for AutoHotKey], and not .txt [as is the case with text files]. It may be possible that this file extension isn’t appearing on your computer or that you aren’t able to change it, in which case you will have to enable file extensions on your computer. Save this file on your desktop for convenience.

Right-click on this file and select the ‘Edit Script’ option. The default editing interface for such files, Notepad, will open.

Paste the following code in the empty file. Doing so will swap the virtual desktop shortcut from ‘Ctrl’ + WinKey + Left/Right Arrow key to Page Down + End Keys button.

;Switch to right virtual desktop PgDn:: Send, {LControl down}#{Right}{LControl up} return ;Switch to left virtual desktop End:: Send, {LControl down}#{Left}{LControl up} return

It is not necessary for you too to have Page Down and End as the shortcut keys to switch over from one virtual desktop to another, although it is recommended for you to select keys that are both, rarely used and lined up close to one another.

You can modify the code by changing PgDn and End in the code above with your preferred keys and it will work just fine, as long as the keys you choose are listed among the ones applicable with AutoHotKey. You can check the list by visiting autohotkey.com.

After doing so, save the file and exit Notepad.

On your desktop, you will find an AutoHotKey script. Double-click on it or right-click and further select ‘Run Script’ to run it.

From there on out, the script will begin to run and you will be able to use the keyboard shortcut of your choice to navigate through virtual desktops on your Windows 10 computer.

You can verify if the script is running or not by checking your System Tray.

We hope that this article was able to help you change the keyboard shortcut for your virtual desktops.

TIP: You can now also use Keyboard Manager PowerToy to remap keyboard shortcuts easily

I just made a script for autohotkey that accomplishes this in Windows 10 for up to 10 desktops.

How to get it working:

Download and install autohotkey. Copy and paste the code bellow into notepad and save it with the file extension .ahk

I suggest making a shortcut of this file in your startup folder so it runs when Windows starts.

DEFAULT HOTKEYS:

Switch desktop: WIN+DESKTOP NUMBER [0 = desktop number 10]

New desktop: CTRL+WIN+D

Close desktop: CTRL+WIN+F4

Display desktop state: WIN+'

IMPORTANT:

In order for it to work you must ONLY use hotkeys for opening, closing, and changing desktops because the script listens for these hotkeys to know the current and total number of desktops.

If you do create, close, or change desktops via the WIN+TAB menu with the mouse the script will stop working. In order to get it working again you will need to edit the first two lines to reflect the current state of your desktops. [desktopcount/currentdesktop]

This doesn't mean you can't use the WIN+TAB screen as an overview of your current desktops. You can actually use it in combination of the hotkeys to organize your desktops. Yes, the hotkeys still work when the windows task viewer is open! [WIN+TAB] Just DO NOT use the mouse!!!

Also, wait for the script to load after Windows startup before creating new desktops or it will not work. This could take a moment depending on how many startup programs you have.

Ok, I added one more thing to make it easier to re-sync the script with your desktop state. There is now a hotkey that will display the state the script believes the desktops to be in so all you have to do is adjust your desktops with the mouse to fit the script and it will be all synced up again! For me with a Swiss keyboard it worked out nicely having the '? key next to 0 and it makes sense with a ? on it, but on other keyboards you may wish to change this which can be done easily by changing the line right after the hotkey for 0/10 [starting with #'] to whatever you like.

Actually, I just realized.... as long as the Desktop Count is correct than creating a new desktop will automatically re-sync the Current Desktop value.

[The lines starting with ; are comments and do not affect the script]

Code:

#NoTrayIcon ;If the script stops working: ;Change the following values to reflect your current desktop state and reload the script. ;Remember to change them back to 1 after reloading the script if you have it set to start with Windows desktopcount := 1 currentdesktop := 1 ;You can change the hotkeys for creating, closing, and switching desktops bellow. ;The current hotkeys are CTRL+WIN+D for new desktop, CTRL+WIN+F4 to close desktop ;and WIN+NUMBER for switching desktops. ;For example, to change the hotkey for new desktop replace ^#D bellow with the desired hotkey. ;Refer to the autohotkey documentation for a full list of symbols refering to modifier keys, ;as you can see ^ is CTRL and # is WIN key. ;If you wanted to change the switch desktop from WIN key to CTRL for example you would have ;to replace the # before each number to a ^ ^#D::NewDesktop[] ^#F4::CloseDesktop[] #1::SwitchDesktop[1] #2::SwitchDesktop[2] #3::SwitchDesktop[3] #4::SwitchDesktop[4] #5::SwitchDesktop[5] #6::SwitchDesktop[6] #7::SwitchDesktop[7] #8::SwitchDesktop[8] #9::SwitchDesktop[9] #0::SwitchDesktop[10] #'::MsgBox Desktop Count = %desktopcount%`nCurrent Desktop = %currentdesktop% ;Do not change anything after this line, unless you know what you are doing ;] ;----------------------------------------------------------------------------------------------- SwitchDesktop[desktop] { global desktopcount global currentdesktop desktopdiff := desktop - currentdesktop if [desktop > desktopcount] { return } if [desktopdiff < 0] { desktopdiff *= -1 Loop %desktopdiff% { Send ^#{Left} } } else if [desktopdiff > 0] { Loop %desktopdiff% { Send ^#{Right} } } currentdesktop := desktop } NewDesktop[] { global desktopcount global currentdesktop if [desktopcount > 9] { return } desktopcount ++ currentdesktop := desktopcount Send ^#d } CloseDesktop[] { global desktopcount global currentdesktop desktopcount -- if [currentdesktop != 1] { currentdesktop -- } Send ^#{f4} }

Video liên quan

Chủ Đề