Sync: from windows

This commit is contained in:
js0ny 2024-12-09 22:31:29 +00:00
parent 2fa5801448
commit 485d7eada5
10 changed files with 722 additions and 540 deletions

View file

@ -72,3 +72,5 @@ ${function:wini} = { winget install $args }
${function:winr} = { winget uninstall $args }
${function:wins} = { winget search $args }
${function:winu} = { winget upgrade $args }
${function:killp} = {ps | ? ProcessName -like $args | kill -Force}

View file

@ -1,33 +1,142 @@
#Requires AutoHotkey v2.0
; #b::
; Run '"C:\Program Files\Zotero\zotero.exe"'
; return
; #f::
; Run '"C:\Program Files\GPSoftware\Directory Opus\dopus.exe"'
; return
; #q::
; Send '!{F4}'
; return
; #r::
; Run '"C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.21.3231.0_x64__8wekyb3d8bbwe\wt.exe"'
; return
#h::
Send '{Left}'
return
{
Send("{Left}")
}
#n::
Send '{Down}'
return
{
Send("{Down}")
}
#e::
Send '{Up}'
return
{
Send("{Up}")
}
#i::
Send '{Right}'
return
{
Send("{Right}")
}
{
Send("{Home}")
}
#a:: ; Vim-like navigation: Append
{
Send("{End}")
}
#q:: ; Simulate cmd+q in macOS
{
Send("!{F4}")
}
; 定义一个全局状态变量,标记是否触发了组合键
global CapsLockState := false
; 当 CapsLock 作为修饰键与其他键一起使用时
CapsLock & s:: {
global CapsLockState
CapsLockState := true
Run("ShareX.exe -RectangleRegion")
}
; 单独按下 CapsLock 时,发送 Esc
CapsLock:: {
global CapsLockState
; 如果之前未使用组合键,则发送 Esc
if not CapsLockState {
Send("{Esc}")
}
CapsLockState := false ; 重置状态
}
; 释放 CapsLock 时重置状态
*CapsLock Up:: {
global CapsLockState
CapsLockState := false
}
#HotIf WinActive('ahk_exe' 'QQ.exe')
^n::
{
Send("^{Down}")
}
^h::
{
Send("^{Left}")
}
^i::
{
Send("^{Enter}")
}
^e::
{
Send("^{Up}")
}
#HotIf WinActive('ahk_exe' 'Weixin.exe')
^n::
{
Send("{Down}")
}
^e::
{
Send("{Up}")
}
#HotIf WinActive('ahk_exe' 'Discord.exe')
^n::
{
Send("^!{Down}")
}
^e::
{
Send("^!{Up}")
}
#HotIf WinActive('ahk_exe' 'olk.exe')
^n::
{
Send("{Down}")
}
^+n::
{
Send("^.")
}
^+e::
{
Send("^,")
}
^e::
{
Send("{Up}")
}
#HotIf WinActive('ahk_exe' 'SumatraPDF.exe')
^\::
{
Send("{F12}")
}
#HotIf WinActive('ahk_exe' 'Flow.Launcher.exe')
^a::
{
Send("{End}")
}
^+a::
{
Send("^a")
}
^l::
{
Send("{Home}")
}
^+BackSpace::
{
Send("^a{Backspace}")
}
#HotIf WinActive('ahk_exe' 'Obsidian.exe')
^e::
{
Send("^p")
}
#HotIf