Hoykey stops working, doesn't work twice in a row

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Frankie158
Posts: 4
Joined: 13 Dec 2017, 08:23

Hoykey stops working, doesn't work twice in a row

13 Dec 2017, 08:33

Hey, I've been messing with Autohotkey for about an hour, and browsed all forums I could with my issue, but no matter what I do, I can't resolve it. Here's my issue.
My AMD settings updated, and I want to assign the overlay a hotkey. It's current setting is for ctrl+alt+r, which opens it, and pressing those again dismisses it. However, autohotkey will open it once, clicking it again will do nothing, and once I manually close it with the actual key combo, the button won't work again until I reload the script.
What I originally had was

Code: Select all

NumpadLeft::
   Send, ^!r
Return
But this didn't work, so I tried a bunch of different combos such as

Code: Select all

NumpadLeft::
   Send, {ctrl down}
sleep 40
   Send, {alt down}
sleep 40
   Send, {r down}
Return
I've tried probably a dozen other's as well, but I don't wanna clog this post. No matter what I do, the string will activate the AMD overlay, but will not dismiss it with a second click. Than for whatever reason, that string no longer works. All I want is to click it once, then click it again to dismiss it when I need to. And then for the key to continue functioning as needed.
Thanks :) New to this, and trying my hardest to figure this out myself, but hit a wall and need some help.
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Hoykey stops working, doesn't work twice in a row

13 Dec 2017, 14:07

Try:

Code: Select all

NumpadLeft::Send, {ctrl down}{alt down}r{alt up}{ctrl up}
My guess is that the keys are logically getting stuck in the down position, which is preventing the hotkey from working a second time. Telling them to release (go back up) usually fixes it.
Frankie158
Posts: 4
Joined: 13 Dec 2017, 08:23

Re: Hoykey stops working, doesn't work twice in a row

13 Dec 2017, 17:32

Osprey wrote:Try:

Code: Select all

NumpadLeft::Send, {ctrl down}{alt down}r{alt up}{ctrl up}
My guess is that the keys are logically getting stuck in the down position, which is preventing the hotkey from working a second time. Telling them to release (go back up) usually fixes it.
Didn't work, but I just realized that yea it seems to keep both ctrl and alt pressed down. After pressing the hotkey (your string does the same thing, no change), my PC acts as if both are still pressed until I manually press them myself. So after clicking it, scrolling down a page changes it's zoom (like when holding ctrl), I click ctrl and it stops. But now it thinks I'm holding alt, and opens links in a new tab. Once I press both keys at least once, it returns to normal. I'm than able to reactive the overlay, but can't dismiss it and go through the same thing all over again.
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Hoykey stops working, doesn't work twice in a row

13 Dec 2017, 18:47

I don't know why that code doesn't work. You could also try:

Code: Select all

NumpadLeft::Send, {ctrl down}{alt down}r
NumpadLeft Up::Send, {alt up}{ctrl up}
or even:

Code: Select all

NumpadLeft Up::Send, {ctrl down}{alt down}r{alt up}{ctrl up}
If I were you, I'd also test with a more normal key, since numpad keys can sometimes behave a little unexpectedly, since they're toggled by numlock and all.
Frankie158
Posts: 4
Joined: 13 Dec 2017, 08:23

Re: Hoykey stops working, doesn't work twice in a row

13 Dec 2017, 19:02

Still didn't work. Nothing seems to dismiss the overlay afterwards :/ And yea I've tried others, no luck. I have 8 others set for the numlock pad and all work perfectly fine. For example I have volume for numlock end and down, I can mash them a billion times and it adjusts with no issue. As well as steam overlay and all my others, it's specifically this AMD overlay that's giving me issues.
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Hoykey stops working, doesn't work twice in a row

13 Dec 2017, 19:54

Try switching to SendInput mode. You can do:

Code: Select all

NumpadLeft::SendInput, {ctrl down}{alt down}r{alt up}{ctrl up}
or add...

Code: Select all

SendMode Input
...to the top of the script to have it apply to all Send commands.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Hoykey stops working, doesn't work twice in a row

13 Dec 2017, 20:03

- Could it be that the program is admin?
- When you press the hotkey on a non-admin window, the hotkey works, and the program is activated.
- When the program is active, you press the hotkey and it doesn't work, because the active window is admin (and you launched AutoHotkey as non-admin).
- AutoHotkey's hotkeys don't work, if AHK is non-admin, and the active window is admin. There are some exceptions to this.

Hotkey examples (non-admin AHK, on admin windows).

Code: Select all

;this script is intended to be run as non-admin
;e.g. test on RegEdit

;note: even though the hotkeys might work, non-admin AHK will have
;limited rights to interact with an admin window

#UseHook On ;none will work on admin windows because #UseHook on
q::
+q::
^q::
#q::
!q::
MsgBox, % A_ThisHotkey
return

#UseHook Off
w:: ;doesn't work on admin windows
+w:: ;doesn't work on admin windows
^w:: ;works
#w:: ;works
!w:: ;works
MsgBox, % A_ThisHotkey
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, RandomBoy and 420 guests