Page 1 of 1

Using = in hotkey combination

Posted: 26 Apr 2022, 20:56
by asopala
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

Re: Using = in hotkey combination

Posted: 26 Apr 2022, 21:26
by SirSocks
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.

Re: Using = in hotkey combination

Posted: 27 Apr 2022, 13:21
by asopala
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.

Re: Using = in hotkey combination

Posted: 27 Apr 2022, 13:39
by RussF
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 835 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

Re: Using = in hotkey combination

Posted: 27 Apr 2022, 16:38
by asopala
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.

Re: Using = in hotkey combination

Posted: 27 Apr 2022, 16:50
by gregster
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)

Re: Using = in hotkey combination

Posted: 27 Apr 2022, 17:16
by asopala
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.

Re: Using = in hotkey combination

Posted: 27 Apr 2022, 17:19
by gregster
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)

Re: Using = in hotkey combination  Topic is solved

Posted: 27 Apr 2022, 17:28
by gregster
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 ^`=

Re: Using = in hotkey combination

Posted: 05 May 2022, 18:38
by asopala
gregster wrote:
27 Apr 2022, 17:28

Code: Select all

SetKeyDelay 50, 50
SendEvent ^{=}		; or:  SendEvent ^`=
That's what did it. Thanks!

Re: Using = in hotkey combination

Posted: 05 May 2022, 18:49
by gregster
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: