pmb6tz / windows-desktop-switcher

An AutoHotKey script for Windows that lets a user change virtual desktops by pressing CapsLock + <num>.
MIT License
1.23k stars 230 forks source link

How about add OpenDesktopManager feature. #41

Closed lokielse closed 5 years ago

lokielse commented 5 years ago

default key is win+tab. I'd like to customize it.

Elijas commented 5 years ago

You can already customize it!:)

Step 1

Decide what will be your new hotkeys. For this example, let's use Ctrl + Space, which will trigger Win + Tab

Step 2

Find the commands (symbols) for each of the buttons. For example:

Button Command
Ctrl ^
Space space
Win #
Tab tab

You can find the table for all of the buttons here.

Step 3

Edit the file user_config.ahk and add this line at the bottom of the file:

^space::send, #{tab}
Click here for explanation. You make the program do a **command** with your selected **hotkeys** like this: ```ahk HOTKEYS::COMMAND ``` In our case we want the program to click some **buttons** (Win+Tab) when we press the hotkeys. The way to do this is to use the command `send` (comma is optional): ```ahk HOTKEYS::send, BUTTONS ``` If we want that pressing `Ctrl` + `Space` would press the buttons `h` `e` `l` `l` `o`, then we use this line ```ahk ^space::send, hello ``` If we want it to automatically press a button other than a letter, then we use `{` `}` around it (For example `tab` should be `{tab}`). In this example `Ctrl` + `Space` will press the buttons `Win` + `Tab`: ```ahk ^space::send, #{tab} ``` You can read more about how it works [here](https://www.autohotkey.com/docs/Hotkeys.htm)

Step 4

Start the program.

If it is already running, you can click the tray icon with the right button and select Reload.

(EDIT: Fixed the errors and formatting)

lokielse commented 5 years ago

@Elijas Thanks for your detail guide.

// This one is work, but it is not my wanted.
^`::!tab

// This is what I want, but it dose not work.
^`::#tab
Elijas commented 5 years ago

Oops, it seems that I gave the wrong solution. I've just got to my computer and fixed it. Try this:

^space::send, #{tab}

I've updated the comment above and explained this in more detail, too!

lokielse commented 5 years ago

That's amazing!! It works like a charm. how do you come so cool. :D