Using = in hotkey combination Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
asopala
Posts: 21
Joined: 23 May 2021, 13:52

Using = in hotkey combination

26 Apr 2022, 20:56

Hey all,

Basically, I'm trying to do this:

Code: Select all

numpadEnter::
	Send ^{=}
	Return
It doesn't seem to work. When pressing Ctrl and = myself, it works, but it doesn't seem to send in Autohotkey.

I looked it up, and there's been similar issues in the past, but I couldn't find a solution. Anyone able to help? I also tried the following with no success:

Code: Select all

numpadEnter::
	Send ^=
	Return
	
numpadEnter::
	Send {Ctrl}{=}
	Return
User avatar
SirSocks
Posts: 360
Joined: 26 Oct 2018, 08:14

Re: Using = in hotkey combination

26 Apr 2022, 21:26

Try using Scan Codes or Virtual Keys. Here's some info on that...
https://jacks-autohotkey-blog.com/2016/04/14/understanding-autohotkey-keyboard-scan-codes-and-virtual-key-codes-beginning-hotkeys-part-12/

Try this.....

Code: Select all

numpadenter::
Send, ^{raw}=
Return
Or this...

Code: Select all

numpadenter::
Send, ^{sc55}
Return

Note: Code is untested.
asopala
Posts: 21
Joined: 23 May 2021, 13:52

Re: Using = in hotkey combination

27 Apr 2022, 13:21

SirSocks wrote:
26 Apr 2022, 21:26
Try using Scan Codes or Virtual Keys. Here's some info on that...
https://jacks-autohotkey-blog.com/2016/04/14/understanding-autohotkey-keyboard-scan-codes-and-virtual-key-codes-beginning-hotkeys-part-12/

Try this.....

Code: Select all

numpadenter::
Send, ^{raw}=
Return
Or this...

Code: Select all

numpadenter::
Send, ^{sc55}
Return

Note: Code is untested.
That didn't seem to do it. It just doesn't register. And it's not my enter key, I tried on a couple different keys. It just doesn't seem to be sending that equals sign.
RussF
Posts: 1296
Joined: 05 Aug 2021, 06:36

Re: Using = in hotkey combination

27 Apr 2022, 13:39

The following code:

Code: Select all

f12::
    Send, % "==="
    Send, ^{=}
    KeyHistory
    Return
shows that the correct keys are being sent:
image.png
image.png (8.36 KiB) Viewed 792 times
Ctrl-= is an unusual keyboard combination to use and doesn't create any printable characters. What application are you trying to send it to and are you sure that is the correct combo?

Russ
asopala
Posts: 21
Joined: 23 May 2021, 13:52

Re: Using = in hotkey combination

27 Apr 2022, 16:38

RussF wrote:
27 Apr 2022, 13:39
The following code:

Code: Select all

f12::
    Send, % "==="
    Send, ^{=}
    KeyHistory
    Return
shows that the correct keys are being sent:
image.png

Ctrl-= is an unusual keyboard combination to use and doesn't create any printable characters. What application are you trying to send it to and are you sure that is the correct combo?

Russ
I'm using it in Pro Tools, and I'm 100% sure that's the combo. That's what works manually doing that, I just wanted to make a quick key for it so I can just hit it quickly.
gregster
Posts: 9087
Joined: 30 Sep 2013, 06:48

Re: Using = in hotkey combination

27 Apr 2022, 16:50

If Pro Tools is running with elevated rights, your script needs them as well to be able to send to it (see https://www.autohotkey.com/docs/commands/Run.htm#RunAs)
asopala
Posts: 21
Joined: 23 May 2021, 13:52

Re: Using = in hotkey combination

27 Apr 2022, 17:16

gregster wrote:
27 Apr 2022, 16:50
If Pro Tools is running with elevated rights, your script needs them as well to be able to send to it (see https://www.autohotkey.com/docs/commands/Run.htm#RunAs)
Got it elevated, same issue. Every other key command I've programmed in works, BTW. It's just this one giving me trouble.
gregster
Posts: 9087
Joined: 30 Sep 2013, 06:48

Re: Using = in hotkey combination

27 Apr 2022, 17:19

Did you try to send the scan code which gets reported in the KeyHistory for your = key? (https://www.autohotkey.com/docs/KeyList.htm#SpecialKeys)
Did your KeyHistory look similar to RussF's ?
(I don't even have a = key, on my keyboard layout it's a shifted 0)
gregster
Posts: 9087
Joined: 30 Sep 2013, 06:48

Re: Using = in hotkey combination  Topic is solved

27 Apr 2022, 17:28

Otherwise, there is also

Code: Select all

Send {Ctrl down}{=}{Ctrl up}  ; or:  Send {Ctrl down}={Ctrl up}
or

Code: Select all

SetKeyDelay 50, 50
SendEvent ^{=}		; or:  SendEvent ^`=
asopala
Posts: 21
Joined: 23 May 2021, 13:52

Re: Using = in hotkey combination

05 May 2022, 18:38

gregster wrote:
27 Apr 2022, 17:28

Code: Select all

SetKeyDelay 50, 50
SendEvent ^{=}		; or:  SendEvent ^`=
That's what did it. Thanks!
gregster
Posts: 9087
Joined: 30 Sep 2013, 06:48

Re: Using = in hotkey combination

05 May 2022, 18:49

Okay, cool, thanks for the feedback. I think sending artificial keys on Windows is inherently inconsistent.
So trial-and-error with the known methods is the way to go. :thumbup:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: DaveF, Giresharu and 125 guests