AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

holding a key down?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
nvus



Joined: 02 Aug 2007
Posts: 29

PostPosted: Mon Jul 21, 2008 4:18 pm    Post subject: holding a key down? Reply with quote

i lost my script somewhere but i had it so that it remapped one of my mousebuttons to F12 and when i held down that mousebutton, it would spam F12 at a certain interval. when i let go of the mousebutton, it would stop

anyone have any ideas?
Back to top
View user's profile Send private message
HugoV



Joined: 27 May 2007
Posts: 650

PostPosted: Mon Jul 21, 2008 4:21 pm    Post subject: Re: holding a key down? Reply with quote

nvus wrote:
anyone have any ideas?
Search the forum? http://www.autohotkey.com/forum/topic30392.html
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Jul 21, 2008 4:26 pm    Post subject: Re: holding a key down? Reply with quote

HugoV wrote:
nvus wrote:
anyone have any ideas?
Search the forum? http://www.autohotkey.com/forum/topic30392.html

read my post? i did search and i did look at that topic already... its not what i want.
Back to top
Crackpot
Guest





PostPosted: Mon Jul 21, 2008 4:50 pm    Post subject: Reply with quote

Code:
LButton::
Loop
{
GetKeyState, state, Lbutton, P
if state=U
break
{
Sendinput {F12}
Sleep 10
}
}


Which is modifed from this script:

http://www.autohotkey.com/forum/topic22063.html&highlight=rapid+fire
Back to top
Guest






PostPosted: Mon Jul 21, 2008 4:59 pm    Post subject: Reply with quote

Crackpot wrote:
Code:
LButton::
Loop
{
GetKeyState, state, Lbutton, P
if state=U
break
{
Sendinput {F12}
Sleep 10
}
}


Which is modifed from this script:

http://www.autohotkey.com/forum/topic22063.html&highlight=rapid+fire

thanks, but theres still something wrong... this seems to do a double spam sometimes which doesnt allow me to hit other keys... the script i had was similar to this but there wasnt a loop... is was like

xbutton1::
{
GetKeyState, state, Lbutton, P
if state=D
{
Sendinput {F12}
Sleep 200
}
}
return
Back to top
nvus



Joined: 02 Aug 2007
Posts: 29

PostPosted: Mon Jul 21, 2008 5:04 pm    Post subject: Reply with quote

xbutton1::
GetKeyState, state, xbutton1, P
if state=D
{
Sendinput {F12}
Sleep 200
}


this is what i have so far but it doesnt spam F12 at an interval of 200ms. it only clicks F12 once
Back to top
View user's profile Send private message
Crackpot
Guest





PostPosted: Mon Jul 21, 2008 5:05 pm    Post subject: Reply with quote

Double spam is probably because of the low Sleep time, the script still has the mouse held down when it starts at the top, increase the Sleep a bit and mod it. It was just a rough version anyway.
Back to top
nvus



Joined: 02 Aug 2007
Posts: 29

PostPosted: Mon Jul 21, 2008 5:07 pm    Post subject: Reply with quote

Crackpot wrote:
Double spam is probably because of the low Sleep time, the script still has the mouse held down when it starts at the top, increase the Sleep a bit and mod it. It was just a rough version anyway.

can you modify it so that it only spams if im holding the key down? if i release the key then it stops spamming?

and the double spam still happens when i increased the sleep to 200.. i used Sleep 200 on my old script and it didnt do that

the script i had wasnt a loop
Back to top
View user's profile Send private message
Crackpot
Guest





PostPosted: Mon Jul 21, 2008 5:36 pm    Post subject: Reply with quote

Code:
LButton::
Loop
{
GetKeyState, state, Lbutton, P
if state=U
{
return
}
{
Send {F12}
Sleep 500
}
}
return


Change the number after sleep to increase/decrease the speed. I'm afraid if there's a way to do it without a loop then I don't know it. Easiest way is with the loop. I tested this one and it doesn't double click. Like I said, the double spam was because the sleep timer was too low.
Back to top
nvus



Joined: 02 Aug 2007
Posts: 29

PostPosted: Mon Jul 21, 2008 5:51 pm    Post subject: Reply with quote

Crackpot wrote:
Code:
LButton::
Loop
{
GetKeyState, state, Lbutton, P
if state=U
{
return
}
{
Send {F12}
Sleep 500
}
}
return


Change the number after sleep to increase/decrease the speed. I'm afraid if there's a way to do it without a loop then I don't know it. Easiest way is with the loop. I tested this one and it doesn't double click. Like I said, the double spam was because the sleep timer was too low.

ok this works but for some reason i cant hold the button down and click other buttons at the same time...
Back to top
View user's profile Send private message
Crackpot



Joined: 21 Jul 2008
Posts: 5

PostPosted: Mon Jul 21, 2008 5:58 pm    Post subject: Reply with quote

Just change the Send {F12} to SendInput {F12}. That should solve the problem.
Back to top
View user's profile Send private message
nvus



Joined: 02 Aug 2007
Posts: 29

PostPosted: Mon Jul 21, 2008 6:17 pm    Post subject: Reply with quote

Crackpot wrote:
Just change the Send {F12} to SendInput {F12}. That should solve the problem.

does the same thing... i wish i had saved my script Sad
Back to top
View user's profile Send private message
Crackpot



Joined: 21 Jul 2008
Posts: 5

PostPosted: Mon Jul 21, 2008 6:47 pm    Post subject: Reply with quote

When I tested it I was alt tabbing and typing in notepad with the Left mouse button held down.
Back to top
View user's profile Send private message
nvus



Joined: 02 Aug 2007
Posts: 29

PostPosted: Mon Jul 21, 2008 6:48 pm    Post subject: Reply with quote

Crackpot wrote:
When I tested it I was alt tabbing and typing in notepad with the Left mouse button held down.

i was testing it with the game i play and i was holding onto the spam button and hold control and F1 at the same time.....is there a way to retrieve deleted files? i deleted the script today >.<
Back to top
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Mon Jul 21, 2008 6:56 pm    Post subject: Reply with quote

Code:
*XButton1::
If !GetKeyState("XButton1","p")
   return
SendInput, {blind}{F12}
SetTimer, *XButton1, -500
return
....?....
_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group