#include <Misc.au3> Global $isSingleCaps = True HotKeySet("{LAUNCH_MAIL}", "HoldModifier") While 1 Sleep(60000) WEnd Func HoldModifier() $isSingleCaps = True If _IsPressed("B4") Then HotKeySet("w", "CloseTab") HotKeySet("t", "RunAllTests") HotKeySet("]", "RestartExplorer") HotKeySet("a", "Play") HotKeySet("{NUMPADSUB}", "VolumeUp") HotKeySet("0", "RealCaps") While _IsPressed("B4") sleep(0) WEnd Unset() EndIf If $isSingleCaps Then Send("!+9") EndIf EndFunc Func Unset() HotKeySet("w") HotKeySet("t") HotKeySet("]") HotKeySet("a") HotKeySet("{NUMPADSUB}") HotKeySet("0") EndFunc Func CloseTab() $isSingleCaps = False If StringInStr(WinGetTitle("[active]"), "Microsoft Visual Studio", 1, -1) Then Send("^{F4}") Else Send("^{w}") EndIf EndFunc Func RunAllTests() $isSingleCaps = False If StringInStr(WinGetTitle("[active]"), "Microsoft Visual Studio", 1, -1) Then Send("^u") Send("^l") EndIf EndFunc Func RestartExplorer() $isSingleCaps = False ShellExecute("taskkill", "/im explorer.exe /f") ProcessWaitClose("explorer.exe") Run("C:\Windows\explorer.exe") EndFunc Func VolumeUp() $isSingleCaps = False Send("{VOLUME_UP 3}") EndFunc Func Play() Unset() $isSingleCaps = False If StringInStr(WinGetTitle("[active]"), "Total Commander", 1, -1) Then Send("{RIGHT}") Send("+{RIGHT}") Send("aimp3.exe /add_play ") Send("{BACKSPACE}") Send("^p") Send("{ENTER}") Send("{ENTER}") Send("{LEFT}") EndIf EndFunc Func RealCaps() Unset() $isSingleCaps = False $var = InputBox("To UpperCase", " UpperCase") Send(StringUpper($var)) EndFunc
#include <Misc.au3> ; Misc.au3 _IsPressed, Global $isSingleCaps = True ; HotKeySet("{LAUNCH_MAIL}", "HoldModifier") ; , While 1 Sleep(60000) ; " " WEnd
Func HoldModifier() $isSingleCaps = True If _IsPressed("B4") Then ; _IsPressed HotKeySet("w", "CloseTab") ; , HotKeySet("t", "RunAllTests") HotKeySet("]", "RestartExplorer") HotKeySet("a", "Play") HotKeySet("{NUMPADSUB}", "VolumeUp") HotKeySet("0", "RealCaps") While _IsPressed("B4") ; sleep(0) WEnd Unset() EndIf If $isSingleCaps Then ; $isSingleCaps , , Send("!+9") ; "!" - Alt, "+" - Shift, Alt+Shift+9 EndIf EndFunc Func Unset() HotKeySet("w") ; HotKeySet HotKeySet("t") HotKeySet("]") HotKeySet("a") HotKeySet("{NUMPADSUB}") HotKeySet("0") EndFunc
Func CloseTab() $isSingleCaps = False If StringInStr(WinGetTitle("[active]"), "Microsoft Visual Studio", 1, -1) Then ; Send("^{F4}") Else Send("^{w}") ; Caps+W EndIf EndFunc
Func RunAllTests() $isSingleCaps = False If StringInStr(WinGetTitle("[active]"), "Microsoft Visual Studio", 1, -1) Then Send("^u") Send("^l") EndIf EndFunc
Func RestartExplorer() $isSingleCaps = False ShellExecute("taskkill", "/im explorer.exe /f") ProcessWaitClose("explorer.exe") Run("C:\Windows\explorer.exe") EndFunc
Func VolumeUp() $isSingleCaps = False Send("{VOLUME_UP 3}") ; {VOLUME_UP} EndFunc
Func Play() Unset() $isSingleCaps = False If StringInStr(WinGetTitle("[active]"), "Total Commander", 1, -1) Then Send("{RIGHT}") ; Send("+{RIGHT}") ; Send("aimp3.exe /add_play ") ; Send("{BACKSPACE}") ; / Send("^p") ; Send("{ENTER}") Send("{ENTER}") Send("{LEFT}") ; EndIf EndFunc
Func RealCaps() Unset() $isSingleCaps = False $var = InputBox("To UpperCase", " UpperCase") Send(StringUpper($var)) EndFunc
While 1 If _IsPressed("B4") Then ... EndIf Sleep(50) WEnd
Source: https://habr.com/ru/post/150754/
All Articles