So i was trying to make a hot key for a game that i play and i got it to work but when i do my win+p again it doesn't turn off and i was wondering if any of you guys new what the problem was. Here is the code that im working with.
#MaxThreadsPerHotKey 2
SetKeyDelay, 1500
#p::
toggle := !toggle
loop
{
if toggle
send t{up}{enter}
else
break
}
return
Trouble Coding Topic is solved
Re: Trouble Coding Topic is solved
That's actually fairly clever. I think the problem is that toggle is being interpreted as a string in the if statement, so it's always true. Try changing if toggle to if (toggle).
Re: Trouble Coding
It didnt work thx for thrying tho
Re: Trouble Coding
Here's a possible solution:
Code: Select all
#If !toggle
q::
toggle := 1
Loop
{
if toggle
SoundBeep
else
break
Sleep, 500
}
return
#If
#If toggle
q::
toggle := 0
return
#If
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Trouble Coding
It didnt work and it goes to fast because there is no delay! NVM it worked thanks so much