Why do I get a CTRL key pressed when I should not, or should I? Topic is solved

Ask gaming related questions (AHK v1.1 and older)
WekizZ
Posts: 73
Joined: 14 Jul 2017, 04:40

Why do I get a CTRL key pressed when I should not, or should I?

Post by WekizZ » 27 Jan 2024, 03:59

Code: Select all

*$!LButton::
    While (GetKeyState("LButton", "P"))
	{
		Random rand2, 15, 25
        Send {LButton}
		Sleep %rand2%
    }
return
Maybe this image is irrelevant, but I see that Alt also works wrong, Alt should be down, while LButton is clicking.
Untitled.png
Untitled.png (169.32 KiB) Viewed 233 times
Rohwedder
Posts: 7657
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Why do I get a CTRL key pressed when I should not, or should I?  Topic is solved

Post by Rohwedder » 27 Jan 2024, 04:26

Hallo,
try:

Code: Select all

#InstallKeybdHook
#InstallMouseHook
*$!LButton::
	While (GetKeyState("LButton", "P"))
	{
		Random rand2, 15, 25
		Click
		Sleep %rand2%
	}
	KeyHistory
return ; i=Ignored because it was generated by an AHK script
; A2  01D	i	d	0.00	LControl       	
; A2  01D	i	u	0.00	LControl    
WekizZ
Posts: 73
Joined: 14 Jul 2017, 04:40

Re: Why do I get a CTRL key pressed when I should not, or should I?

Post by WekizZ » 27 Jan 2024, 04:44

@Rohwedder I was so close to try something like this but it didnt work... Right now it works and it looks like there are no random CTRL input and/or ALT going up and down.
Also could you explain why do I need *$.

oh right, thank you ;)
Post Reply

Return to “Gaming Help (v1)”