Netmano93
Netmano93

Reputation: 85

Understanding Autohotkey Controlsend command

ControlSend,, test, ahk_exe notepad.exe

The above works just fine but the following does not, it should englarge the text in notepad.

ControlSend,, ^{+}, ahk_exe notepad.exe

I have also, tried

ControlSend,, {Control down}+{Control up}, ahk_exe notepad.exe

I dont really care for notepad, I am just stuck with controlsend and I am trying understand it. Often it will lose focus to the target window after triggering the hotkey. Is there a special rule in Controlsend, that gets it to keep focus where it is, after triggering the command? For example sending the following to notepad, will activate it. I thought the whole point was to maintain focus where it is.

ControlSend,, ^s, ahk_exe notepad.exe

In the last example, A window is being created so it may be a bad example but many times this issues occurs when sending simple, standard hotkeys to programs

Thanks!

Upvotes: 1

Views: 6077

Answers (1)

Spyre
Spyre

Reputation: 2344

Using Notepad's Alt menu to trigger the zoom in command instead of trying to send a Control Plus lead me to this solution:

WinMenuSelectItem, ahk_exe notepad.exe, , View, Zoom, Zoom In

Many of the commands that you use shortcuts for (such as Zoom, save, and etc) can be triggered from this menu as well. This method also meets the requirement of not activating the Window when triggered.

Upvotes: 4

Related Questions