Hello,
I'm trying to run a hotkey many times with primary key down.
For example the key is Ctrl + U, but I want to keep pressing Ctrl while I press repeatedly the U key.
Is possible to do that?
Run again and again a hotkey with primary key down
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Run again and again a hotkey with primary key down
Something like this ?
This will hold the ctrl key when you press it once. After pressing it again it will release it.
This will hold the ctrl key when you press it once. After pressing it again it will release it.
Code: Select all
#NoEnv ; for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode, 2
#IfWinActive, Untitled - Notepad <------- might be a good idea if you only want to use it in certain program (example for notepad)
$LControl::
Toggle := !Toggle
If (Toggle)
{
Send {CtrlDown}
ToolTip, CTRL = Down
} Else {
Send {CtrlUp}
ToolTip, CTRL = Up
}
Return
Re: Run again and again a hotkey with primary key down
Thank you WalkerOfTheDay, but actually... no.
I should mention "holding" the Ctrl key, and then pressing repeatedly C, or whatever.
But I figured out how to do it inspired by some posts from here:
^u up::
{
send, part%n%
n++
send ^+{left}
}
Very interesting your code also. I think I know where to use it elsewhere.
I should mention "holding" the Ctrl key, and then pressing repeatedly C, or whatever.
But I figured out how to do it inspired by some posts from here:
^u up::
{
send, part%n%
n++
send ^+{left}
}
Very interesting your code also. I think I know where to use it elsewhere.