Thank you.
Code: Select all
$d::
keywait, d, T0.5
if errorlevel
Send e
else
Send d
return
Code: Select all
$d::
keywait, d, T0.5
if errorlevel
Send e
else
Send d
return
Code: Select all
$d::
keywait, d, T0.5
if errorlevel
Send e
else
Send d
keywait, d
; d key down would immediately trigger $d:: again
return
Code: Select all
$d::
keywait, d, T0.5
Send,% ErrorLevel?"e":"d"
keywait, d
; d key down would immediately trigger $d:: again
return
Code: Select all
#Requires AutoHotkey v2.0
$d::Send(KeyWait("d", "T0.5")?"e":"d"), KeyWait("d")
Code: Select all
$d::
keywait, d, T0.5
if errorlevel
Run, C:\Users\Jr\Desktop\Mute2.ahk
else
Send d
keywait, d
; d key down would immediately trigger $d:: again
return
Thank you.V0RT3X wrote: ↑05 Apr 2024, 06:56Haven't tested myself, but I would have a look at Rohwedder's code at...
viewtopic.php?f=76&t=125300&p=556712&hilit=long+press#p556696
Code: Select all
$d::
keywait, d, T0.5
if errorlevel
Soundbeep
Send e
else
Send d
keywait, d
; d key down would immediately trigger $d:: again
return
Code: Select all
#IFWinActive, ahk_exe notepad.exe
$d::
keywait, d, T0.5
if errorlevel {
SoundBeep
Send e
} else Send d
keywait, d
; d key down would immediately trigger $d:: again
return
#IFWinActive
Code: Select all
$d::
keywait, d, T0.5
if errorlevel
Run, C:\Users\Jr\Desktop\Mute2.ahk
else
Send d
keywait, d
; d key down would immediately trigger $d:: again
return
Code: Select all
#IFWinActive, ahk_exe notepad.exe
$d::
keywait, d, T0.5
if errorlevel {
SoundBeep
Send e
} else Send d
keywait, d
; d key down would immediately trigger $d:: again
return
#IFWinActive
Code: Select all
#IFWinActive, ahk_exe notepad.exe
$d::
Switch, Morse() {
Case "0":Send d ;single short press sends d
Case "1":Send e ; single long press sends e
Case "00":Send f ; send "f" with double tapping of "d" key
Default:MsgBox,, Pattern without Case,% Pattern, 3
} Return
#IFWinActive
Morse(Timeout = 500) {
Global Pattern := ""
RegExMatch(A_ThisHotkey, "\W$|\w*$", Key)
While, !ErrorLevel {
T := A_TickCount
KeyWait %Key%
Pattern .= A_TickCount-T > Timeout
KeyWait %Key%,% "DT" Timeout/1000
} Return Pattern
}
Code: Select all
#IFWinActive, ahk_exe notepad.exe
$d::
Switch, Morse() {
Case "0":Send d ;single short press sends d
Case "1":Send e ; single long press sends e
Case "00":Send f ; send "f" with double tapping of "d" key
Case "000":Send g ; send "g" with double tapping of "d" key
Default:MsgBox,, Pattern without Case,% Pattern, 3
} Return
#IFWinActive
Morse(Timeout = 350) {
Global Pattern := ""
RegExMatch(A_ThisHotkey, "\W$|\w*$", Key)
While, !ErrorLevel {
T := A_TickCount
KeyWait %Key%
Pattern .= A_TickCount-T > Timeout
KeyWait %Key%,% "DT" Timeout/1000
} Return Pattern
}
Code: Select all
$d::
keywait, d, T0.5
if errorlevel
Run, C:\Users\Jr\Desktop\Mute2.ahk
else
Send d
keywait, d
; d key down would immediately trigger $d:: again
return
Code: Select all
KeyWait %Key%,% "DT" Timeout/1000
Code: Select all
; "d" key sends all coeds
#IFWinActive, ahk_exe notepad.exe
$d::
Switch, Morse() {
Case "0":Send d ;single short press sends d
Case "00":Send f ; send "f" with double tapping of "d" key
Case "000":Send g ; send "g" with double tapping of "d" key
Case "1":Send e ; single long press sends e
Default:MsgBox,, Pattern without Case,% Pattern, 3
} Return
#IFWinActive
Morse(Timeout = 350) {
Global Pattern := ""
RegExMatch(A_ThisHotkey, "\W$|\w*$", Key)
While, !ErrorLevel {
T := A_TickCount
KeyWait %Key%
Pattern .= A_TickCount-T > Timeout
KeyWait %Key%,% "DT" Timeout/1000
} Return Pattern
}
Users browsing this forum: AlFlo, Bing [Bot] and 151 guests