Skip to content

Instantly share code, notes, and snippets.

@mmqmzk
Last active March 5, 2023 09:28
Show Gist options
  • Save mmqmzk/d0a847892b375350d68083eb37ccafc9 to your computer and use it in GitHub Desktop.
Save mmqmzk/d0a847892b375350d68083eb37ccafc9 to your computer and use it in GitHub Desktop.
Hot window keys
Set oWS = WScript.CreateObject("WScript.Shell")
iReturn = oWS.Run("""%ProgramFiles%\AutoHotkey\AutoHotkey.exe"" ""%NUT_STORE%\Config\AHK\win.ahk""", 0, False)
Set oWS = WScript.CreateObject("WScript.Shell")
iReturn = oWS.Run("""%ChocolateyInstall%\bin\AutoHotkey.exe"" ""%NUT_STORE%\Config\AHK\win.ahk2""", 0, False)
Loop, %0% {
param := %A_Index%
params .= A_Space . param
}
ShellExecute := A_IsUnicode
? "shell32\ShellExecute" : "shell32\ShellExecuteA"
If not A_IsAdmin {
If A_IsCompiled {
DllCall(ShellExecute, uint, 0, str, "RunAs", str
, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1)
} Else {
DllCall(ShellExecute, uint, 0, str, "RunAs", str
, A_AhkPath, str, """" . A_ScriptFullPath . """" . A_Space . params
, str, A_WorkingDir, int, 1)
}
ExitApp
}
#MaxThreadsPerHotkey 1
ENGLISH = 1033
CHINESE = 2052
EnvGet, PROGRAM64, ProgramFiles
EnvGet, PROGRAM86, ProgramFiles(x86)
PROGRAM_DATA := "C:\ProgramData"
CHROMIUM_EXE := "msedge.exe"
CHROMIUM_APP := PROGRAM86 . "\Microsoft\Edge\Application"
CHROMIUM := CHROMIUM_APP . CHROMIUM_EXE
CHROMIUM_PROXY := CHROMIUM_APP . "\msedge_proxy.exe"
EnvGet, APP_DATA, APPDATA
EnvGet, SYS_ROOT, SystemRoot
SYSTEM32 := SYS_ROOT . "\System32"
SSH_EXE := SYSTEM32 . "\OpenSSH\ssh.exe"
TOOLS := "C:\Tools"
SCH_TASK = "schtasks.exe /RUN /TN"
START_MENU := APP_DATA . "\Microsoft\Windows\Start Menu"
ImSelect(code) {
Run, im-select.exe %code%, , Hide
}
SendAndSelect(text) {
len := StrLen(text)
SendRaw, %text%
Sleep, 50
Send, +{Left %len%}
Sleep, 50
}
SwitchCase(input) {
StringCaseSense, On
StringUpper, upper, input
StringLower, lower, input
StringUpper, title, input, T
Switch input {
Case upper:
Return lower
Case lower:
Return title
Default:
Return upper
}
}
ToggleCase() {
Sleep 200
ClipSave := ClipboardAll
Send, ^{c}
text := Clipboard
text := SwitchCase(text)
SendAndSelect(text)
Clipboard := ClipSave
ClipSave =
}
RotateCase(input) {
input := Trim(input)
space := RegExReplace(input, "[_\W]+", " ")
StringLower, space, space
under := RegExReplace(input, "[_\W]+", "_")
minus := RegExReplace(input, "[_\W]+", "-")
StringUpper, title, space, T
camel := RegExReplace(title, "[_\W]+")
StringCaseSense, On
Switch input {
Case space, camel:
Return title
Case title:
Return minus
Case minus:
Return under
Case under:
Return camel
Default:
Return space
}
}
TitleCase() {
Sleep 200
ClipSave := ClipboardAll
Send, ^{c}
text := Clipboard
StringCaseSense, On
If RegExMatch(text, "[_\W]+") {
text := RotateCase(text)
} Else {
text := RegExReplace(text, "([A-Z]|[0-9]+)", " $1")
text := RegExReplace(text, "[_\W]+", " ")
text := Trim(text)
StringLower, text, text
}
SendAndSelect(text)
Clipboard := ClipSave
ClipSave =
}
ToggleWindow(title, state) {
SetTitleMatchMode 2
If WinExist(title) {
If state {
WinMinimize
} Else {
WinActivate
}
Return !state
}
Return state
}
;========== Chromium ==========
OpenQuickTab() {
global ENGLISH
ImSelect(ENGLISH)
ShowChromium()
Sleep, 50
Send, +!x
Return 1
}
ShowChromium() {
global CHROMIUM_EXE
title := "Main Browser ahk_exe " . CHROMIUM_EXE
If !ToggleWindow(title, 0) {
global CHROMIUM
Run, "%CHROMIUM%"
WinWaitActive, title, , 10
}
Return
}
RunWebApp(appId) {
global CHROMIUM_PROXY
app := "--app-id=" . appId
Run, "%CHROMIUM_PROXY%" --profile-directory=Default "%app%"
}
RunSchduleOnDesktop(task) {
global SSH_EXE
global SCH_TASK
cmd := SCH_TASK . " " . task
Run, "%SSH_EXE%" desktop "%cmd%", , Hide
}
SetTimer, TimIMEHandler, 1000
; ========== AutoAdb ==========
global hAutoADB
Menu Tray, Icon
; Menu Tray, Icon, %NUT_STORE%\Favicon\android.png
Menu Tray, Add, Show / Hide AutoADB, TrayClick
Menu Tray, Default, Show / Hide AutoADB
;// Run autoadb hidden
DetectHiddenWindows On
hAutoADB := WinExist("ahk_exe autoadb.exe")
If (hAutoADB == 0) {
Run, autoadb.exe cmd.exe /C start scrcpy.vbs {}, , Hide, pid
WinWait ahk_pid %pid%
hAutoADB := WinExist()
}
DetectHiddenWindows Off
return
TrayClick:
OnTrayClick()
return
OnTrayClick() {
global hAutoADB
if DllCall("IsWindowVisible", "Ptr", hAutoADB) {
WinHide ahk_id %hAutoADB%
} else {
WinShow ahk_id %hAutoADB%
WinActivate ahk_id %hAutoADB%
}
}
;========== Chromium ==========
#b::
; ShowChromium()
; Sleep, 50
; Send, !{b}
; Return
; ======
; If OpenQuickTab() {
; Sleep, 500
; Send, /b{Space}
; } Else {
; Send, ^#b
; }
Send, ^#b
Return
#c::
global CHROMIUM_EXE
title := "Main Browser ahk_exe " . CHROMIUM_EXE
ToggleWindow(title, 0)
Return
!#c::
WinGetClass, output, A
Clipboard := output
MsgBox, "The active control's class is %output%, %ErrorLevel%".
Return
#+^d::
global TOOLS
Run, "%TOOLS%\SwitchVirtualDesktopCycle.lnk"
Return
#g::
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
Send, ^!#g
Return
}
ShowChromium()
Sleep, 20
Send, {F4}
Return
#h::
; ShowChromium()
; Sleep, 50
; Send, !h
If OpenQuickTab() {
global ENGLISH
ImSelect(ENGLISH)
Sleep, 500
Send, /h{Space}
}
Return
#m::
ShowChromium()
Sleep, 50
Send, !+m
Return
#s::
Send, ^{Ins}
ShowChromium()
Sleep, 50
Send, !+s
Return
^,::
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
Send, !#^{,}
Return
}
OpenQuickTab()
Return
; ========== Web Apps ==========
; #!N::
; title = "neonpad"
; If (neonpadState != ToggleWindow(title, neonpad_state)) {
; neonpadState := !neonpadState
; } Else {
; RunWebApp("agnokbmgkbdgcaifgeogncaebpaahfpj")
; WinWaitActive, title
; neonpadState = 1
; }
; Return
#o::
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
Sleep, 500
Send, ^!#o
Return
}
global CHROMIUM_EXE
title := "Notion ahk_exe " . CHROMIUM_EXE
If (notionState != ToggleWindow(title, notionState)) {
notionState = 0
} Else {
RunWebApp("cnmnfnkedfekfidgojcdmndbcipagogc")
WinWaitActive, title
}
Send, ^p
Return
#^,::
global START_MENU
Run, "%START_MENU%\Programs\SimpRead Later.lnk"
Return
; ========== 1Password ==========
#p::
Send, !#p
Return
; ========== Windows Terminal ==========
^`::
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
Sleep, 100
Send, ^!#``
Return
}
wtClass := "ahk_class CASCADIA_HOSTING_WINDOW_CLASS"
If (wtState != ToggleWindow(wtClass, wtState)) {
wtState = 0
} Else {
Run, wt.exe
WinWaitActive,wtClass, , 10
wtState = 0
}
Return
!^`::
EnvGet, isMain, MAIN_PC
wtClass := "ahk_class CASCADIA_HOSTING_WINDOW_CLASS"
If (isMain <> "true") {
ToggleWindow(wtClass, 0)
Return
}
RunSchduleOnDesktop("terminal")
Return
; ========== File Manager ==========
#e::
If (tcState != ToggleWindow("ahk_exe TOTALCMD64.EXE", tcState)) {
tcState := 0
} Else {
Run, "%TCMD%"
WinWaitActive, "ahk_exe TOTALCMD64.EXE", , 10
tcState = 0
}
Return
#^e::
Run, "explorer.exe"
Return
#f::
Send, #^+f
; Run, "%PROGRAM64%\Everything\Everything.exe" -home
Return
#^f::
global PROGRAM64
Run, "%PROGRAM64%\Everything\Everything.exe"
-search most_run: -sort "Run Count" -sort-descending
Return
^#l::
global TOOLS
Run, "%TOOLS%\LockOther.lnk"
Sleep, 500
DllCall("user32.dll\LockWorkStation")
Return
; ========== Jetbrains ==========
#j::
EnvGet, isMain, MAIN_PC
If (isMain == "true") {
ToggleWindow("shenghe.local", 0)
Sleep, 100
RunSchduleOnDesktop("win-j")
Return
}
ideaState := ToggleWindow("rainbow-island ahk_exe idea64.exe", 0)
Return
#^j::
jClientState := ToggleWindow("ahk_exe jetbrains_client64.exe", 0)
Return
#k::#+^k
#^k::
if (procexp64State != ToggleWindow("ahk_exe procexp64.exe", procexp64State)) {
procexp64State := 0
} Else {
global PROGRAM_DATA
Run, "%PROGRAM_DATA%\chocolatey\lib\procexp\tools\procexp64.exe"
WinWaitActive, "ahk_exe procexp64.exe", , 10
procexp64State = 0
}
Return
; ========== Tencent ==========
#q::
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
Sleep, 200
Send, ^!#q
Return
}
timState := ToggleWindow("ahk_exe Tim.exe", 0)
Return
; ========== String Processing ==========
#t::
Send, #+^t
Return
#u::
Send, #+^u
Return
#w::
Send, #+^w
Return
; ========== Ditto ==========
; #v::
; Run, %ProgramFiles%/Ditto/Ditto.exe /Open
; Return
; !#V::
; Run, %ProgramFiles%/Ditto/Ditto.exe /PlainTextPaste
; Return
; #v::
; OldClip := Clipboard
; Run, C:\Tools\Clipto.lnk
; Sleep, 500
; WinWaitClose, Clipto, , 15
; if ErrorLevel {
; Return
; }
; Sleep, 2000
; Send, !{Esc}
; If (OldClip == Clipboard) {
; OldClip =
; Return
; }
; Sleep, 200
; Send, +{Ins}
; OldClip =
; Return
; ========== CopyQ ==========
#v::
global PROGRAM86
Run, "%PROGRAM86%\copyq\copyq.exe" toggle
Return
#^n::
global PROGRAM86
Run, "%PROGRAM86%\copyq\copyq.exe" eval "next();paste()"
Return
#^p::
global PROGRAM86
Run, "%PROGRAM86%\copyq\copyq.exe" eval "previous();paste()"
Return
#Numpad0::
global PROGRAM86
Run, "%PROGRAM86%\copyq\copyq.exe" eval "select(0);paste()"
Return
#Numpad1::
global PROGRAM86
Run, "%PROGRAM86%\copyq\copyq.exe" eval "select(1);paste()"
Return
#Numpad2::
global PROGRAM86
Run, "%PROGRAM86%\copyq\copyq.exe" eval "select(2);paste()"
Return
#Numpad3::
global PROGRAM86
Run, "%PROGRAM86%\copyq\copyq.exe" eval "select(3);paste()"
Return
; ========== Others ==========
#z::
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
Sleep, 500
Send, !#^z
Return
}
If WinExist("ahk_exe zeal.exe") {
Send #^z
} Else {
global START_MENU
Run, "%START_MENU%\Programs\zeal.lnk"
}
Return
PrintScreen::
global TOOLS
Run, "%TOOLS%\Snipaste-Snip.lnk"
Return
; ===================================
!Space::
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
Send, !+^{Space}
} else {
; Run, "%LOCALAPPDATA%\Programs\utools\uTools.exe"
Send, #{F12}
}
Return
^Space::
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
Send, !#+{Space}
} else {
Send, !#l
}
Return
~Alt::
If WinExist("shenghe.local") {
Return
}
If (altPressed > 0) {
altPressed += 1
Return
}
altPressed := 1
SetTimer, AltPressHandler, -200
Return
~Ctrl::
If WinExist("shenghe.local") {
Return
}
If (ctrlPressed > 0) {
ctrlPressed += 1
Return
}
ctrlPressed := 1
SetTimer, CtrlPressedHanler, -200
Return
AltPressHandler:
If (altPressed == 2) {
EnvGet, isMain, MAIN_PC
If (isMain <> "true") {
; Run, "%LOCALAPPDATA%\Programs\utools\uTools.exe"
Send, #{F12}
} else {
RunSchduleOnDesktop("utools-once")
}
}
altPressed := 0
Return
CtrlPressedHanler:
If (ctrlPressed == 2) {
EnvGet, isMain, MAIN_PC
If (isMain == "true") {
RunSchduleOnDesktop("win-alt-l")
}
}
ctrlPressed := 0
Return
TimImeHandler:
If (WinActive("ahk_exe TIM.exe")) {
if (timIME) {
Return
}
timIME = 1
global ENGLISH
ImSelect(ENGLISH)
global CHINESE
ImSelect(CHINESE)
} else {
timIME = 0
}
Return
global params := ""
For , arg In A_Args {
params := A_Space . arg
}
ShellExecute := "shell32\ShellExecute"
If not A_IsAdmin {
If A_IsCompiled {
DllCall(ShellExecute, "uInt", 0, "Str", "RunAs", "Str"
, A_ScriptFullPath, "Str", params , "Str", A_WorkingDir, "Int", 1)
} Else {
DllCall(ShellExecute, "uInt", 0, "Str", "RunAs", "Str"
, A_AhkPath, "Str", '"' . A_ScriptFullPath . '"' . A_Space . params, "Str", A_WorkingDir, "Int", 1)
}
ExitApp
}
global ENGLISH := "1033"
global CHINESE := "2052"
global PROGRAM86 := EnvGet("ProgramFiles(x86)")
global PROGRAM64 := EnvGet("ProgramFiles")
global APPDATA := EnvGet("APPDATA")
global CHROMIUM_EXE := "msedge.exe"
global CHROMIUM_APP := PROGRAM86 . "\Microsoft\Edge\Application\"
global CHROMIUM := CHROMIUM_APP . CHROMIUM_EXE
global CHROMIUM_PROXY := CHROMIUM_APP . "msedge_proxy.exe"
global COPYQ := PROGRAM86 . "\copyq\copyq.exe"
global TCMD := EnvGet("TCMD")
global SYS_ROOT := EnvGet("SystemRoot")
global SYSTEM32 := SYS_ROOT . "\System32"
global SSH_EXE := SYSTEM32 . "\OpenSSH\ssh.exe"
global TOOLS := "C:\Tools"
global SCH_TASK := "schtasks.exe /RUN /TN"
global START_MENU := APPDATA . "\Microsoft\Windows\Start Menu"
global timIME := 0
global neonpadState := 0
global chromeState := 0
global notionState := 0
global wtState := 0
global timState := 0
global tcState := 0
global ideaState := 0
global jClientState := 0
global procexpState := 0
ImSelect(code) {
Run "im-select.exe " . code, , "Hide"
}
SendAndSelect(text) {
len := StrLen(text)
SendText text
Sleep 50
Send "+{Left %len%}"
Sleep 50
}
SwitchCase(input) {
upper := StrUpper input
lower := StrLower input
title := StrTitle input
Switch input, "On" {
Case upper:
Return lower
Case lower:
Return title
Default:
Return upper
}
}
ToggleCase() {
Sleep 200
ClipSave := ClipboardAll
Send "^{c}"
text := Clipboard
text := SwitchCase(text)
SendAndSelect(text)
Clipboard := ClipSave
ClipSave := ""
}
RotateCase(input) {
input := Trim(input)
space := RegExReplace(input, "[_\W]+", " ")
space := StrLower space
under := RegExReplace(input, "[_\W]+", "_")
minus := RegExReplace(input, "[_\W]+", "-")
title := StrTitle space
camel := RegExReplace(title, "[_\W]+")
Switch input, "On" {
Case space, camel:
Return title
Case title:
Return minus
Case minus:
Return under
Case under:
Return camel
Default:
Return space
}
}
TitleCase() {
Sleep 200
ClipSave := ClipboardAll
Send "^{c}"
text := Clipboard
If RegExMatch(text, "[_\W]+") {
text := RotateCase(text)
} Else {
text := RegExReplace(text, "i)([A-Z]|[0-9]+)", " $1")
text := RegExReplace(text, "[_\W]+", " ")
text := Trim(text)
text := StrLower text
}
SendAndSelect(text)
Clipboard := ClipSave
ClipSave := ""
}
ToggleWindow(title, state) {
SetTitleMatchMode 2
SetTitleMatchMode "Slow"
If WinExist(title) {
If state {
WinMinimize
} Else {
WinActivate
WinWaitActive
}
Return !state
}
Return state
}
RunSchduleOnDesktop(task) {
cmd := SCH_TASK . " " . task
Run "%SSH_EXE%" desktop "%cmd%", , Hide
}
;========== Chromium ==========
OpenQuickTab() {
ImSelect(ENGLISH)
ShowChromium()
Sleep 50
Send "!{x}"
Return 1
}
ShowChromium() {
title := "Main Browser ahk_exe " . CHROMIUM_EXE
If !ToggleWindow(title, 0) {
Run CHROMIUM
WinWaitActive "title", , 10
}
}
RunWebApp(appId) {
app := "--app-id=" . appId
Run CHROMIUM_PROXY . " -profile-directory=Default " . app
}
;// Show / "Hide" AutoADB on double click
OnTrayClick(ItemName, ItemPos, aMenu) {
global hAutoADB
if DllCall("IsWindowVisible", "Ptr", hAutoADB) {
WinHide "ahk_id " . hAutoADB
} else {
WinShow "ahk_id " . hAutoADB
WinActivate "ahk_id " . hAutoADB
}
}
TimImeHandler() {
global timIME
If (WinActive("ahk_exe TIM.exe")) {
if (timIME != 0) {
Return
}
timIME := 1
ImSelect(ENGLISH)
ImSelect(CHINESE)
} else {
timIME := 0
}
}
SetTimer TimIMEHandler, 1000
; ========== AutoAdb ==========
; Menu "Tray", "Icon"
; Menu "Tray", "Icon", NUT_STORE . "\Favicon\android.png"
; Menu "Tray", "Default", "Show" / "Hide" autoadb
A_TrayMenu.Add("Show / Hide AutoADB", OnTrayClick)
;// Run autoadb hidden
DetectHiddenWindows "On"
global hAutoADB := WinExist("ahk_exe autoadb.exe")
If (hAutoADB == 0) {
Run autoadb.exe cmd.exe /C start scrcpy.vbs {}, , "Hide", &pid
WinWait "ahk_pid " . pid
hAutoADB := WinExist()
}
DetectHiddenWindows "Off"
Return
;========== Chromium ==========
#b:: {
Send "^#b"
}
#c:: {
title := "Main Browser ahk_exe " . CHROMIUM_EXE
If (chromeState != ToggleWindow(title, chromeState)) {
chromeState := !chromeState
}
}
#!c:: {
output := WinGetClass("A")
Clipboard := output
title := WinGetTitle("A")
MsgBox "The active control's class is " . output . ", Title = " . title
}
#^+d:: {
Run TOOLS . "\SwitchVirtualDesktopCycle.lnk"
}
#g::
F16:: {
isMain := EnvGet("MAIN_PC")
If (isMain != "true") {
Send "^!#g"
Return
}
ShowChromium()
Sleep 50
Send "{F4}"
}
#h:: {
ShowChromium()
Sleep 50
Send "!H"
; If OpenQuickTab() {
; Sleep, 50
; Send, /h{Space}
; }
}
#m:: {
ShowChromium()
Sleep 50
Send "!M"
}
#s:: {
Send "^{Ins}"
ShowChromium()
Sleep 50
Send "+!S"
}
#p:: {
Send "#!P"
}
^,::
F17:: {
isMain := EnvGet("MAIN_PC")
If (isMain != "true") {
Send "^!#{,}"
Return
}
OpenQuickTab()
}
; ========== Web Apps ==========
; #!n:: {
; title := "neonpad"
; If (neonpadState != ToggleWindow(title, neonpadState)) {
; neonpadState := !neonpadState
; } Else {
; ; RunWebApp("agnokbmgkbdgcaifgeogncaebpaahfpj")
; RunWebApp("chhimdaamcpegdphmomkcjhlabehlnjj")
; WinWaitActive title
; neonpadState := 1
; }
; }
#o::
F18:: {
isMain := EnvGet("MAIN_PC")
If (isMain != "true") {
Sleep 500
Send "^!#O"
Return
}
global notionState
title := "Notion ahk_exe " . CHROMIUM_EXE
; title := "ahk_exe notion.exe"
If (notionState != ToggleWindow(title, notionState)) {
notionState := 0
} Else {
RunWebApp("cnmnfnkedfekfidgojcdmndbcipagogc")
WinWaitActive title
}
Send "^p"
}
#^,:: {
Run START_MENU . "\Programs\SimpRead Later.lnk"
}
; ========== Windows Terminal ==========
^`::
F14:: {
isMain := EnvGet("MAIN_PC")
If (isMain != "true") {
Sleep 100
Send "^!#``"
Return
}
wtClass := "ahk_class CASCADIA_HOSTING_WINDOW_CLASS"
If (wtState != ToggleWindow(wtClass, wtState)) {
wtState := 0
} Else {
Run "wt.exe"
WinWaitActive wtClass, , 10
wtState := 0
}
}
^!`::
F20:: {
isMain := EnvGet("MAIN_PC")
If (isMain == "true") {
Sleep 100
Send "^#+``"
Return
}
wtClass := "ahk_class CASCADIA_HOSTING_WINDOW_CLASS"
If (wtState != ToggleWindow(wtClass, wtState)) {
wtState := 0
} Else {
Run "wt.exe"
WinWaitActive wtClass, , 10
wtState := 0
}
}
; ========== File Manager ==========
#e:: {
tcTitle := "ahk_exe TOTALCMD64.EXE Total Commander"
If (tcState != ToggleWindow(tcTitle, tcState)) {
tcState := 0
} Else {
Run TCMD
WinWaitActive tcTitle, , 10
tcState := 0
}
}
#^e:: {
Run "explorer.exe"
}
#f:: {
Run PROGRAM64 . "\Everything\Everything.exe -home"
}
#^f:: {
Run PROGRAM64 . "\Everything\Everything.exe -search most_run: -sort `"Run Countg`" -sort-descending"
}
^#l:: {
Run TOOLS . "\LockOther.lnk"
Sleep 500
DllCall("user32.dll\LockWorkStation")
}
; ========== Jetbrains ==========
#j:: {
isMain := EnvGet("MAIN_PC")
If (isMain == "true") {
Sleep 100
RunSchduleOnDesktop("win-j")
Return
}
; ideaState := ToggleWindow("ahk_exe idea64.exe", 0)
Send "#7"
}
#^j:: {
global jClientState
jClientState := ToggleWindow("ahk_exe jetbrains_client64.exe", 0)
}
#k::^+#k
#^k:: {
if (procexpState != ToggleWindow("ahk_exe procexp64.exe", procexpState)) {
procexpState := 0
} Else {
Run "C:\ProgramData\chocolatey\lib\procexp\tools\procexp64.exe"
WinWaitActive "ahk_exe procexp64.exe", , 10
procexpState := 1
}
}
; ========== Tencent ==========
#q::
F13:: {
isMain := EnvGet("MAIN_PC")
If (isMain != "true") {
Sleep 200
Send "^!#q"
Return
}
If (ToggleWindow("ahk_exe Tim.exe", 0) == 0) {
Run PROGRAM86 . "\Tencent\Tim\Bin\TIM.exe"
}
}
; ========== String Processing ==========
#t:: {
Send "#^+t"
}
#u:: {
Send "#^+u"
}
#w:: {
Send "#^+w"
}
; ========== CopyQ ==========
#v:: {
Run COPYQ . " toggle"
}
#^n:: {
Run COPYQ . " eval next();paste()"
}
#^p:: {
Run COPYQ . " eval previous();paste()"
}
#Numpad0:: {
Run COPYQ . " eval select(0);paste()"
}
#Numpad1:: {
Run COPYQ . " eval select(1);paste()"
}
#Numpad2:: {
Run COPYQ . " eval select(2);paste()"
}
#Numpad3:: {
Run COPYQ . " eval select(3);paste()"
}
; ========== Others ==========
#z::
F19:: {
isMain := EnvGet("MAIN_PC")
If (isMain != "true") {
Sleep 500
Send "^!#z"
Return
}
If WinExist("ahk_exe zeal.exe") {
Send "#^z"
} Else {
Run START_MENU . "\Programs\zeal.lnk"
}
}
PrIntScreen:: {
Run TOOLS . "\Snipaste-Snip.lnk"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment