454 lines
7 KiB
AutoHotkey
454 lines
7 KiB
AutoHotkey
;;Use on admin windows without admin rights: https://www.autohotkey.com/docs/v1/Program.htm#Installer_uiAccess
|
|
#SingleInstance Force
|
|
hotkeyLock := 0
|
|
|
|
sendCheckCapsLock(command, clCommand)
|
|
{
|
|
if (GetKeyState("CapsLock", "T"))
|
|
{
|
|
Send, {%clCommand%}
|
|
}
|
|
else
|
|
{
|
|
Send, {%command%}
|
|
}
|
|
}
|
|
|
|
;;Change virtual desktop
|
|
;;RAlt::SendInput ^#{Left}
|
|
|
|
;;General remappings
|
|
CapsLock::LControl
|
|
RShift & LShift::CapsLock
|
|
LShift & RShift::CapsLock
|
|
LCtrl::AppsKey
|
|
;;*CapsLock::return
|
|
return
|
|
|
|
#if !hotkeyLock
|
|
;;Adding tonic vowels with tilde, EUR sign, ü and ñ to non-ES keyboard
|
|
<!a::
|
|
sendCheckCapsLock("U+00E1", "U+00C1")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
<!+a::
|
|
sendCheckCapsLock("U+00C1", "U+00E1")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
<!e::
|
|
sendCheckCapsLock("U+00E9", "U+00C9")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
<!+e::
|
|
sendCheckCapsLock("U+00C9", "U+00E9")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
<!i::
|
|
sendCheckCapsLock("U+00ED", "U+00CD")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
<!+i::
|
|
sendCheckCapsLock("U+00CD", "U+00ED")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
<!o::
|
|
sendCheckCapsLock("U+00F3", "U+00D3")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
<!+o::
|
|
sendCheckCapsLock("U+00D3", "U+00F3")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
<!u::
|
|
sendCheckCapsLock("U+00FA", "U+00DA")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
<!+u::
|
|
sendCheckCapsLock("U+00DA", "U+00FA")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
<!n::
|
|
sendCheckCapsLock("U+00F1", "U+00D1")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
<!+n::
|
|
sendCheckCapsLock("U+00D1", "U+00F1")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
;;U with umlaut ü
|
|
<!/::
|
|
sendCheckCapsLock("U+00FC", "U+00DC")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
<!+/::
|
|
sendCheckCapsLock("U+00DC", "U+00FC")
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
;;Adding euro sign
|
|
<!p::
|
|
Send, {U+20AC}
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
<!+p::
|
|
Send, {U+20AC}
|
|
hotkeyLock := 1
|
|
KeyWait, LAlt
|
|
hotkeyLock := 0
|
|
return
|
|
|
|
#if
|
|
|
|
#if hotkeyLock
|
|
;;Prevent accidental special character entry
|
|
<!a::
|
|
sendCheckCapsLock("U+0061", "U+0041")
|
|
return
|
|
<!+a::
|
|
sendCheckCapsLock("U+0041", "U+0061")
|
|
return
|
|
|
|
<!b::
|
|
sendCheckCapsLock("U+0062", "U+0042")
|
|
return
|
|
<!+b::
|
|
sendCheckCapsLock("U+0042", "U+0062")
|
|
return
|
|
|
|
<!c::
|
|
sendCheckCapsLock("U+0063", "U+0043")
|
|
return
|
|
<!+c::
|
|
sendCheckCapsLock("U+0043", "U+0063")
|
|
return
|
|
|
|
<!d::
|
|
sendCheckCapsLock("U+0064", "U+0044")
|
|
return
|
|
<!+d::
|
|
sendCheckCapsLock("U+0044", "U+0064")
|
|
return
|
|
|
|
<!e::
|
|
sendCheckCapsLock("U+0065", "U+0045")
|
|
return
|
|
<!+e::
|
|
sendCheckCapsLock("U+0045", "U+0065")
|
|
return
|
|
|
|
<!f::
|
|
sendCheckCapsLock("U+0066", "U+0046")
|
|
return
|
|
<!+f::
|
|
sendCheckCapsLock("U+0046", "U+0066")
|
|
return
|
|
|
|
<!g::
|
|
sendCheckCapsLock("U+0067", "U+0047")
|
|
return
|
|
<!+g::
|
|
sendCheckCapsLock("U+0047", "U+0067")
|
|
return
|
|
|
|
<!h::
|
|
sendCheckCapsLock("U+0068", "U+0048")
|
|
return
|
|
<!+h::
|
|
sendCheckCapsLock("U+0048", "U+0068")
|
|
return
|
|
|
|
<!i::
|
|
sendCheckCapsLock("U+0069", "U+0049")
|
|
return
|
|
|
|
<!+i::
|
|
sendCheckCapsLock("U+0049", "U+0069")
|
|
return
|
|
|
|
<!j::
|
|
sendCheckCapsLock("U+006A", "U+004A")
|
|
return
|
|
<!+j::
|
|
sendCheckCapsLock("U+004A", "U+006A")
|
|
return
|
|
|
|
<!k::
|
|
sendCheckCapsLock("U+006B", "U+004B")
|
|
return
|
|
<!+k::
|
|
sendCheckCapsLock("U+004B", "U+006B")
|
|
return
|
|
|
|
<!l::
|
|
sendCheckCapsLock("U+006C", "U+004C")
|
|
return
|
|
<!+l::
|
|
sendCheckCapsLock("U+004C", "U+006C")
|
|
return
|
|
|
|
<!m::
|
|
sendCheckCapsLock("U+006D", "U+004D")
|
|
return
|
|
<!+m::
|
|
sendCheckCapsLock("U+004D", "U+006D")
|
|
return
|
|
|
|
<!n::
|
|
sendCheckCapsLock("U+006E", "U+004E")
|
|
return
|
|
<!+n::
|
|
sendCheckCapsLock("U+004E", "U+006E")
|
|
return
|
|
|
|
<!o::
|
|
sendCheckCapsLock("U+006F", "U+004F")
|
|
return
|
|
<!+o::
|
|
sendCheckCapsLock("U+004F", "U+006F")
|
|
return
|
|
|
|
<!p::
|
|
sendCheckCapsLock("U+0070", "U+0050")
|
|
return
|
|
<!+p::
|
|
sendCheckCapsLock("U+0050", "U+0070")
|
|
return
|
|
|
|
<!q::
|
|
sendCheckCapsLock("U+0071", "U+0051")
|
|
return
|
|
<!+q::
|
|
sendCheckCapsLock("U+0051", "U+0071")
|
|
return
|
|
|
|
<!r::
|
|
sendCheckCapsLock("U+0072", "U+0052")
|
|
return
|
|
<!+r::
|
|
sendCheckCapsLock("U+0052", "U+0072")
|
|
return
|
|
|
|
<!s::
|
|
sendCheckCapsLock("U+0073", "U+0053")
|
|
return
|
|
<!+s::
|
|
sendCheckCapsLock("U+0053", "U+0073")
|
|
return
|
|
|
|
<!t::
|
|
sendCheckCapsLock("U+0074", "U+0054")
|
|
return
|
|
<!+t::
|
|
sendCheckCapsLock("U+0054", "U+0074")
|
|
return
|
|
|
|
<!u::
|
|
sendCheckCapsLock("U+0075", "U+0055")
|
|
return
|
|
<!+u::
|
|
sendCheckCapsLock("U+0055", "U+0075")
|
|
return
|
|
|
|
<!v::
|
|
sendCheckCapsLock("U+0076", "U+0056")
|
|
return
|
|
<!+v::
|
|
sendCheckCapsLock("U+0056", "U+0076")
|
|
return
|
|
|
|
<!w::
|
|
sendCheckCapsLock("U+0077", "U+0057")
|
|
return
|
|
<!+w::
|
|
sendCheckCapsLock("U+0057", "U+0077")
|
|
return
|
|
|
|
<!x::
|
|
sendCheckCapsLock("U+0078", "U+0058")
|
|
return
|
|
<!+x::
|
|
sendCheckCapsLock("U+0058", "U+0078")
|
|
return
|
|
|
|
<!y::
|
|
sendCheckCapsLock("U+0079", "U+0059")
|
|
return
|
|
<!+y::
|
|
sendCheckCapsLock("U+0059", "U+0079")
|
|
return
|
|
|
|
<!z::
|
|
sendCheckCapsLock("U+007A", "U+005A")
|
|
return
|
|
<!+z::
|
|
sendCheckCapsLock("U+005A", "U+007A")
|
|
return
|
|
|
|
<!`::
|
|
Send, {U+0060}
|
|
return
|
|
<!+`::
|
|
Send, {U+007E}
|
|
return
|
|
<!1::
|
|
Send, {U+0031}
|
|
return
|
|
<!+1::
|
|
Send, {U+0021}
|
|
return
|
|
<!2::
|
|
Send, {U+0032}
|
|
return
|
|
<!+2::
|
|
Send, {U+0040}
|
|
return
|
|
<!3::
|
|
Send, {U+0033}
|
|
return
|
|
<!+3::
|
|
Send, {U+0023}
|
|
return
|
|
<!4::
|
|
Send, {U+0034}
|
|
return
|
|
<!+4::
|
|
Send, {U+0024}
|
|
return
|
|
<!5::
|
|
Send, {U+0035}
|
|
return
|
|
<!+5::
|
|
Send, {U+0027}
|
|
return
|
|
<!6::
|
|
Send, {U+0036}
|
|
return
|
|
<!+6::
|
|
Send, {U+005E}
|
|
return
|
|
<!7::
|
|
Send, {U+0037}
|
|
return
|
|
<!+7::
|
|
Send, {U+0026}
|
|
return
|
|
<!8::
|
|
Send, {U+0038}
|
|
return
|
|
<!+8::
|
|
Send, {U+002A}
|
|
return
|
|
<!9::
|
|
Send, {U+0039}
|
|
return
|
|
<!+9::
|
|
Send, {U+0028}
|
|
return
|
|
<!0::
|
|
Send, {U+0030}
|
|
return
|
|
<!+0::
|
|
Send, {U+0029}
|
|
return
|
|
<!-::
|
|
Send, {U+002D}
|
|
return
|
|
<!+-::
|
|
Send, {U+005F}
|
|
return
|
|
<!=::
|
|
Send, {U+003D}
|
|
return
|
|
<!+=::
|
|
Send, {U+002B}
|
|
return
|
|
|
|
<!/::
|
|
Send, {U+002F}
|
|
return
|
|
<!+/::
|
|
Send, {U+003F}
|
|
return
|
|
<!.::
|
|
Send, {U+002E}
|
|
return
|
|
<!+.::
|
|
Send, {U+003E}
|
|
return
|
|
<!,::
|
|
Send, {U+002C}
|
|
return
|
|
<!+,::
|
|
Send, {U+003C}
|
|
return
|
|
<!;::
|
|
Send, {U+003B}
|
|
return
|
|
<!+;::
|
|
Send, {U+003A}
|
|
return
|
|
<!'::
|
|
Send, {U+0027}
|
|
return
|
|
<!+'::
|
|
Send, {U+0022}
|
|
return
|
|
<![::
|
|
Send, {U+005B}
|
|
return
|
|
<!+[::
|
|
Send, {U+007B}
|
|
return
|
|
<!]::
|
|
Send, {U+005D}
|
|
return
|
|
<!+]::
|
|
Send, {U+007D}
|
|
return
|
|
<!\::
|
|
Send, {U+005C}
|
|
return
|
|
<!+\::
|
|
Send, {U+007C}
|
|
return
|
|
|
|
#if
|
|
|
|
;;Where :C?*:U"X:: contains the hotstring trigger, this cASE BEING TYPING U " X ALL together. autohotkey gives us some control over how to interpret the hotstring, IN This Case By Inserting C?* We Are Telling Ahk To Be Case Sensitie (C), to trigger even as part of a word (?) and to trigger without an ending character such as space or newline(*).
|