piusare/piusareLite.ahk

509 lines
8 KiB
AutoHotkey
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;Use on admin windows without admin rights:
;;https://www.autohotkey.com/docs/v1/Program.htm#Installer_uiAccess
;;https://www.autohotkey.com/board/topic/70449-enable-interaction-with-administrative-programs/
Menu, Tray, Tip, Keyboard Remappings
#SingleInstance Force
#MaxHotkeysPerInterval 9999
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, €, ü, ñ, ¿, ¡, and — to non-ES keyboard
<!a::
hotkeyLock := 1
sendCheckCapsLock("U+00E1", "U+00C1")
KeyWait, LAlt
hotkeyLock := 0
return
<!+a::
hotkeyLock := 1
sendCheckCapsLock("U+00C1", "U+00E1")
KeyWait, LAlt
hotkeyLock := 0
return
<!e::
hotkeyLock := 1
sendCheckCapsLock("U+00E9", "U+00C9")
KeyWait, LAlt
hotkeyLock := 0
return
<!+e::
hotkeyLock := 1
sendCheckCapsLock("U+00C9", "U+00E9")
KeyWait, LAlt
hotkeyLock := 0
return
<!i::
hotkeyLock := 1
sendCheckCapsLock("U+00ED", "U+00CD")
KeyWait, LAlt
hotkeyLock := 0
return
<!+i::
hotkeyLock := 1
sendCheckCapsLock("U+00CD", "U+00ED")
KeyWait, LAlt
hotkeyLock := 0
return
<!o::
hotkeyLock := 1
sendCheckCapsLock("U+00F3", "U+00D3")
KeyWait, LAlt
hotkeyLock := 0
return
<!+o::
hotkeyLock := 1
sendCheckCapsLock("U+00D3", "U+00F3")
KeyWait, LAlt
hotkeyLock := 0
return
<!u::
hotkeyLock := 1
sendCheckCapsLock("U+00FA", "U+00DA")
KeyWait, LAlt
hotkeyLock := 0
return
<!+u::
hotkeyLock := 1
sendCheckCapsLock("U+00DA", "U+00FA")
KeyWait, LAlt
hotkeyLock := 0
return
<!n::
hotkeyLock := 1
sendCheckCapsLock("U+00F1", "U+00D1")
KeyWait, LAlt
hotkeyLock := 0
return
<!+n::
hotkeyLock := 1
sendCheckCapsLock("U+00D1", "U+00F1")
KeyWait, LAlt
hotkeyLock := 0
return
;;U with umlaut ü
<!sc01B::
hotkeyLock := 1
sendCheckCapsLock("U+00FC", "U+00DC")
KeyWait, LAlt
hotkeyLock := 0
return
<!+sc01B::
hotkeyLock := 1
sendCheckCapsLock("U+00DC", "U+00FC")
KeyWait, LAlt
hotkeyLock := 0
return
;;Inverted question mark
<!/::
hotkeyLock := 1
Send, {U+00BF}
KeyWait, LAlt
hotkeyLock := 0
return
<!+/::
hotkeyLock := 1
Send, {U+00BF}
KeyWait, LAlt
hotkeyLock := 0
return
;;Euro sign
<!p::
hotkeyLock := 1
Send, {U+20AC}
KeyWait, LAlt
hotkeyLock := 0
return
<!+p::
hotkeyLock := 1
Send, {U+20AC}
KeyWait, LAlt
hotkeyLock := 0
return
;;Inverted exclamation mark
<!sc01A::
hotkeyLock := 1
Send, {U+00A1}
KeyWait, LAlt
hotkeyLock := 0
return
<!+sc01A::
hotkeyLock := 1
Send, {U+00A1}
KeyWait, LAlt
hotkeyLock := 0
return
;;En and em dash
<!sc00C::
hotkeyLock := 1
sendCheckCapsLock("U+2014", "U+2013")
KeyWait, LAlt
hotkeyLock := 0
return
<!+sc00C::
hotkeyLock := 1
sendCheckCapsLock("U+2013", "U+2014")
KeyWait, LAlt
hotkeyLock := 0
return
;;Spanish double angle quotation mark
<!sc01C::
hotkeyLock := 1
sendCheckCapsLock("U+00AB", "U+00BB")
KeyWait, LAlt
hotkeyLock := 0
return
<!+sc01C::
hotkeyLock := 1
sendCheckCapsLock("U+00BB", "U+00AB")
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
<!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+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
<!sc039::
<!+sc039::
Send, {U+0020}
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(*).