0
votes
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!

1
Control sending is always going to be pretty much of a hit or miss. You'll never know what's going to happen. You're basically doing something a program is more than likely not specifically designed to support. Anyway, sending ^{+} seems to work just fine for me. And I'd assume ^s activating the window has nothing to do with the keyevents that are being posted to the window, the file save dialog opening just gets activated when it's opened. - 0x464e
Hmm I fear you are correctly on Controlsend not being reliable...I will continue anyways..THanks though! - Netmano93

1 Answers

1
votes

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.