| View previous topic :: View next topic |
| Author |
Message |
alexisfch
Joined: 09 Nov 2009 Posts: 92
|
Posted: Thu Feb 04, 2010 5:47 pm Post subject: Wait 1 second |
|
|
I need to press a key "b" and If I keep pressed the "b" key wait 2 seconds and only send 1 time the other "b" key.
So if I press "b" key for 5 seconds, I'll only obtain 3 "b" keys. |
|
| Back to top |
|
 |
complx
Joined: 22 Jan 2010 Posts: 34 Location: Germany
|
Posted: Thu Feb 04, 2010 7:40 pm Post subject: |
|
|
Something like this?
| Code: | #singleInstance force
:*:b::
{
KeyWait, b, T2
sendInput b
} |
Edit: ...or better this way?
| Code: | #singleInstance force
:*:b::
{
sendInput b
KeyWait, b, T2
} |
HTH _________________ complx
“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime”—Author unknown |
|
| Back to top |
|
 |
answer4u Guest
|
Posted: Thu Feb 04, 2010 10:41 pm Post subject: |
|
|
How about something like this? | Code: | $b::
If key_down
Send, b
Else {
key_down := True
Sleep, 2000
}
Return
b up:: key_down := False |
|
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Thu Feb 04, 2010 10:43 pm Post subject: |
|
|
Tested and working:
| Code: | $b::
Send, b
KeyWait, b, T2
Return |
_________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
|