 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Justin Guest
|
Posted: Wed Aug 26, 2009 4:14 pm Post subject: Looping a key while... |
|
|
I'm hoping to achieve this:
If Capslock is held and any other key is held ->
Send "other" key repeatedly with a sleep timer.
Otherwise, do nothing.
Something in this sort of format, but with the two key checks, and the second key being sent instead of LButton. Capslock should not be sent at all, and it's native function disabled.
| Code: | Capslock::
Loop
{
If not GetKeyState("Capslock","p")
break
SendEvent, {LButton}
Sleep, 10
}
return |
|
|
| Back to top |
|
 |
Justin Guest
|
Posted: Wed Aug 26, 2009 4:15 pm Post subject: |
|
|
| That "other" key must be any key, like a wildcard in the script. Including Mouse Clicks, so if Capslock + RButton is being held then RButton is sent. If Capslock + LButton is being held then LButton must be sent. |
|
| Back to top |
|
 |
OMG! Guest
|
Posted: Wed Aug 26, 2009 4:22 pm Post subject: |
|
|
| A_ThisHotkey + InStr() + StringSplit + If ... |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Wed Aug 26, 2009 4:37 pm Post subject: |
|
|
Try something like this (does not work for mouse buttons)
| Code: | Capslock::
Loop
{
If not GetKeyState("Capslock","p")
break
Input,v,L1
Send % Chr(1+Asc(v))
Sleep, 10
}
return
CapsLock Up::
Input
Return |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
Justin Guest
|
Posted: Wed Aug 26, 2009 4:58 pm Post subject: |
|
|
| Is there no way to include mouse buttons in something like this? |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Wed Aug 26, 2009 5:46 pm Post subject: |
|
|
Sure
Try pressing Capslock and RButton + Moving Mouse
| Code: | Capslock::
Loop
{
If not GetKeyState("Capslock","p")
break
Input,v,L1
If (ErrorLevel="NewInput"){
if (break and (!break:=0))
break
else {
Loop {
If GetKeyState("LButton","P")
Send {LButton}
else If GetKeyState("RButton","P")
Send {RButton}
else
break
Sleep, 10
}
}
}
Send % Chr(1+Asc(v))
Sleep, 10
}
return
CapsLock Up::
break=1
Input
Return
~LButton::
~RButton::
Input
Return
|
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|