ControlSend with modifier keys

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mhyder1
Posts: 11
Joined: 30 Sep 2022, 16:18

ControlSend with modifier keys

Post by mhyder1 » 31 Jan 2023, 05:14

I have an openfin application that I want to send keystrokes to. The title is Treasury and the ahk_exe is openfin.exe. Here is a small snippet of what I have:

Code: Select all

$^!c::
$^!a::
$^!b::
ControlSend,, %A_ThisHotkey%, Treasury
return
This is not working. I have a similar script I was using to test with in notepad that does work, but it sends the $ character which Im not sure I want:

Code: Select all

$^p::
$^f::
ControlSend,, %A_ThisHotkey%, Untitled - Notepad
return
This script will send $ to notepad and then open the print or find dialog. if I remove the $, it doesnt work.
Any help is appreciated

[Mod edit: Topic moved from 'Scripts and Functions'.]

User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: ControlSend with modifier keys

Post by boiler » 31 Jan 2023, 05:18

Leave the $ in place and make the following modification to the ControlSend line:

Code: Select all

ControlSend,, % SubStr(A_ThisHotkey, 2), Untitled - Notepad

mhyder1
Posts: 11
Joined: 30 Sep 2022, 16:18

Re: ControlSend with modifier keys

Post by mhyder1 » 31 Jan 2023, 09:47

I currently have this, but the application is not responding:

Code: Select all

$^!a::
$^!b::
$^!c::
   ControlSend,, % SubStr(A_ThisHotkey, 2), Treasury
return

User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: ControlSend with modifier keys

Post by boiler » 31 Jan 2023, 09:54

It might have nothing to do with the script and only that the application doesn’t accept virtual keystrokes when it’s not the active window or at all, as is the case with many applications. Try a more simple script and see if it accepts the keystrokes or not:

Code: Select all

ControlSend,, ^!a, Treasury

Post Reply

Return to “Ask for Help (v1)”