Question: how to I declare the following sequence of keystrokes as a hotkey?
- 1. While holding Ctrl key, press the Space bar twice
2. While holding Ctrl key, press Space bar three times
Code: Select all
^Space::
SetTimer, No, -500
No++
Return
No:
If No > 1
MsgBox, % No " ^Spaces"
No =
Return
Thanks for your script, after the attached error message when I run the script afresh, I do get a message box displaying how many spaces I've run. Yet, are there a easier syntax that will declare such sequence of key-strokes as a "standalone shortcut"? Ideally, I am looking for a magic syntax of the following form:Rohwedder wrote:Hallo,
try:Code: Select all
^Space:: SetTimer, No, -500 No++ Return No: If No > 1 MsgBox, % No " ^Spaces" No = Return
Code: Select all
[Something Magic, ^DoubleSpace]::
Code: Select all
^Space::expectSecondSpace := true
#If expectSecondSpace
^Space::
{
MsgBox, % "ctrl+space+space"
expectSecondSpace := false
return
}
#If
~*Ctrl Up::expectSecondSpace := false
Esc::ExitApp
Code: Select all
#space
Code: Select all
DSpace:
DSpace =
Hotkey, ~*Ctrl Up, Off
Return
^Space::
DSpace++
Hotkey, ~*Ctrl Up, DSpace
If DSpace < 2
Return
Gosub, DSpace
I think we are close. Yet, the attached error message is generated, pointing out that `~*Ctrl Up` is not a valid hotkey.Rohwedder wrote:Hallo,
untested!
1. comment out: #Warn in line 60
2. replacebyCode: Select all
#space
Code: Select all
DSpace: DSpace = Hotkey, ~*Ctrl Up, Off Return ^Space:: DSpace++ Hotkey, ~*Ctrl Up, DSpace If DSpace < 2 Return Gosub, DSpace
Thank you for your suggestion!swagfag wrote:Code: Select all
^Space::expectSecondSpace := true #If expectSecondSpace ^Space:: { MsgBox, % "ctrl+space+space" expectSecondSpace := false } #If ~*Ctrl Up::expectSecondSpace := false Esc::ExitApp
Thank you for your suggestion!swagfag wrote:Code: Select all
^Space::expectSecondSpace := true #If expectSecondSpace ^Space:: { MsgBox, % "ctrl+space+space" expectSecondSpace := false } #If ~*Ctrl Up::expectSecondSpace := false Esc::ExitApp
Users browsing this forum: Google [Bot], JoeWinograd and 171 guests