if getkeystate Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SkyLife
Posts: 19
Joined: 18 May 2017, 20:53

if getkeystate

20 May 2017, 05:51

Code: Select all

a::
if GetKeyState("a", "P")
{	
	MsgBox 1
}
return
this code can work, but I don`t want this.

Code: Select all

if GetKeyState("a", "P")
{	
	MsgBox 1
}
return
why the code above cannot work?
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: if getkeystate

20 May 2017, 07:44

What are You trying to achieve? Both codes are the same, with the difference first is a hotkey. At the moment You press "a", the statement is true so MsgBox appears.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
User avatar
boiler
Posts: 17387
Joined: 21 Dec 2014, 02:44

Re: if getkeystate  Topic is solved

20 May 2017, 09:24

Your second code isn't continuously checking the keystate. It just executes once and that's it. You would need a loop or timer or something.
SkyLife
Posts: 19
Joined: 18 May 2017, 20:53

Re: if getkeystate

20 May 2017, 20:03

OK, I got it.
Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Draken, oktavimark and 313 guests