I got a problem with my hotkeys.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AbobaJumber
Posts: 4
Joined: 29 Mar 2023, 06:11

I got a problem with my hotkeys.

Post by AbobaJumber » 29 Mar 2023, 06:26

So basically if i press Ctrl+` my script if working fine in the game, but if i press any other button like W to move or F to block during it, it stops. Here is my script, please help me to make it so other keys dont cancel my hotkey.

Code: Select all

Numpad9::ExitApp
^SC029::
{
	SendInput, {RButton}
	Sleep, 40
	SendInput, {2}
	Sleep, 40
	SendInput, {RButton}
	Sleep, 40
	SendInput, {1}
	Sleep, 40
}
Return

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

Re: I got a problem with my hotkeys.

Post by boiler » 29 Mar 2023, 12:54

What do you mean “it stops”? Your script doesn’t do anything on a repeating basis. You have to press the hotkey to get it to send those things again. Perhaps your game continues to do something until you press another key, but it’s not because pressing those keys stopped what the script was doing.

Are you saying it doesn’t even work if you press the hotkey again?

AbobaJumber
Posts: 4
Joined: 29 Mar 2023, 06:11

Re: I got a problem with my hotkeys.

Post by AbobaJumber » 30 Mar 2023, 04:18

boiler wrote:
29 Mar 2023, 12:54
What do you mean “it stops”? Your script doesn’t do anything on a repeating basis. You have to press the hotkey to get it to send those things again. Perhaps your game continues to do something until you press another key, but it’s not because pressing those keys stopped what the script was doing.

Are you saying it doesn’t even work if you press the hotkey again?
No, the scripts doesnt break or something. The thing is, i want to be able to press other keys while also pressing Ctrl + `, because if i hold Ctrl + ` and press any other button to do something, the Ctrl + ` cancels. Sorry for bad english.

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

Re: I got a problem with my hotkeys.

Post by boiler » 30 Mar 2023, 06:02

That’s not possible using normal hotkey techniques. Maybe someone else can help you with that.

User avatar
mikeyww
Posts: 26859
Joined: 09 Sep 2014, 18:38

Re: I got a problem with my hotkeys.

Post by mikeyww » 30 Mar 2023, 20:29

Hi,

You are posting in the v2 forum.

Bounding braces have no role in v1 subroutines and should be removed.

I would see if your script works in Notepad and if your other keys cause the hotkey subroutine to be aborted there. I ran this test script without difficulty.

Code: Select all

#Requires AutoHotkey v1.1.33
^SC029::
SoundBeep 1500
Click
Sleep 400
Send 2
Sleep 400
Click
Sleep 400
Send 1
Sleep 400
SoundBeep 1000
Return

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

Re: I got a problem with my hotkeys.

Post by boiler » 30 Mar 2023, 21:09

Moved to v1 forum.

AbobaJumber
Posts: 4
Joined: 29 Mar 2023, 06:11

Re: I got a problem with my hotkeys.

Post by AbobaJumber » 01 Apr 2023, 05:04

mikeyww wrote:
30 Mar 2023, 20:29
Hi,

You are posting in the v2 forum.

Bounding braces have no role in v1 subroutines and should be removed.

I would see if your script works in Notepad and if your other keys cause the hotkey subroutine to be aborted there. I ran this test script without difficulty.

Code: Select all

#Requires AutoHotkey v1.1.33
^SC029::
SoundBeep 1500
Click
Sleep 400
Send 2
Sleep 400
Click
Sleep 400
Send 1
Sleep 400
SoundBeep 1000
Return
For some reason, the script you sent doesnt seem to be working at all. Could the problem be that i have AHK of higher version - 1.1.34.04?

AbobaJumber
Posts: 4
Joined: 29 Mar 2023, 06:11

Re: I got a problem with my hotkeys.

Post by AbobaJumber » 01 Apr 2023, 05:13

AbobaJumber wrote:
01 Apr 2023, 05:04
mikeyww wrote:
30 Mar 2023, 20:29
Hi,

You are posting in the v2 forum.

Bounding braces have no role in v1 subroutines and should be removed.

I would see if your script works in Notepad and if your other keys cause the hotkey subroutine to be aborted there. I ran this test script without difficulty.

Code: Select all

#Requires AutoHotkey v1.1.33
^SC029::
SoundBeep 1500
Click
Sleep 400
Send 2
Sleep 400
Click
Sleep 400
Send 1
Sleep 400
SoundBeep 1000
Return
For some reason, the script you sent doesnt seem to be working at all. Could the problem be that i have AHK of higher version - 1.1.34.04?
Nevermind, it works fine. But still, if i press any other key during it, if i hold any other button along with Ctrl + ` during the function, it wont repeat after its finished.

User avatar
mikeyww
Posts: 26859
Joined: 09 Sep 2014, 18:38

Re: I got a problem with my hotkeys.

Post by mikeyww » 01 Apr 2023, 06:59

Code: Select all

#Requires AutoHotkey v1.1.33
^SC029::
While GetKeyState("SC029", "P") {
 SoundBeep 1500
 Click
 Sleep 400
 Send 2
 Sleep 400
 Click
 Sleep 400
 Send 1
 Sleep 400
 SoundBeep 1000
}
Return

Post Reply

Return to “Ask for Help (v1)”