Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ; =================================
- ; ======== Layer functions ========
- ; =================================
- Layered(defaultKey, alterKey)
- {
- if GetKeyState("CapsLock", "T") = 1
- Send {Blind}{%alterKey%}
- else if GetKeyState("CapsLock", "T") = 0
- Send {Blind}{%defaultKey%}
- return
- }
- LayeredControl(defaultKey, alterKey)
- {
- if GetKeyState("CapsLock", "T") = 1
- Send {Blind}{CtrlDown}{%alterKey%}{CtrlUp}
- else if GetKeyState("CapsLock", "T") = 0
- Send {Blind}{%defaultKey%}
- return
- }
- Noop(defaultKey)
- {
- if GetKeyState("CapsLock", "T") = 1
- SoundBeep
- else if GetKeyState("CapsLock", "T") = 0
- Send {Blind}{%defaultKey%}
- return
- }
- ; =================================
- ; ======== Digits row ========
- ; =================================
- $SC029::Noop("SC029")
- $SC002::Layered("SC002","!")
- $SC003::Layered("SC003","""")
- $SC004::Layered("SC004","£")
- $SC005::Layered("SC005","$")
- $SC006::Layered("SC006","%")
- $SC007::Layered("SC007","^")
- $SC008::Layered("SC008","&")
- $SC009::Layered("SC009","*")
- $SC00A::Layered("SC00A","(")
- $SC00B::Layered("SC00B",")")
- $SC00C::Layered("SC00C","_")
- $SC00D::Layered("SC00D","+")
- ; =================================
- ; ======== Top row ========
- ; =================================
- $SC010::Layered("SC010", "Esc")
- ; Ctrl+Shift+Z on W
- $SC011::
- if GetKeyState("CapsLock", "T") = 1
- Send {Blind}^+z
- else if GetKeyState("CapsLock", "T") = 0
- Send {Blind}{SC011}
- return
- $SC012::Layered("SC012", "Backspace")
- $SC013::Layered("SC013", "Del")
- $SC014::Layered("SC014", "Insert")
- $SC015::Layered("SC015", "PgUp")
- $SC016::Layered("SC016", "Home")
- $SC017::Layered("SC017", "Up")
- $SC018::Layered("SC018", "End")
- ; AltGr+P on P
- $SC019::
- if GetKeyState("CapsLock", "T") = 1
- Send {Blind}{RAlt Down}p{RAlt Up}
- else if GetKeyState("CapsLock", "T") = 0
- Send {Blind}{SC019}
- return
- ; =================================
- ; ======== Middle row ========
- ; =================================
- $SC01E::LayeredControl("SC01E", "a")
- $SC01F::Layered("SC01F", "AltDown")
- $SC01F Up::Layered("SC01F Up", "AltUp")
- $SC020::Layered("SC020","ShiftDown")
- $SC020 Up::Layered("SC020 Up", "ShiftUp")
- $SC021::Layered("SC021","CtrlDown")
- $SC021 Up::Layered("SC021 Up", "CtrlUp")
- $SC022::Layered("SC022","Tab")
- $SC023::Layered("SC023","PgDn")
- $SC024::Layered("SC024","Left")
- $SC025::Layered("SC025","Down")
- $SC026::Layered("SC026","Right")
- $SC027::Noop("SC027")
- $SC028::Noop("SC028")
- ; =================================
- ; ======== Bottom row ========
- ; =================================
- $SC02B::Noop("SC02B")
- $SC02C::LayeredControl("SC02C", "z")
- $SC02D::LayeredControl("SC02D", "x")
- $SC02E::LayeredControl("SC02E", "c")
- $SC02F::LayeredControl("SC02F", "v")
- $SC030::Noop("SC030")
- $SC031::LayeredControl("SC031", "Space")
- ; Return on M key
- $SC032::
- if GetKeyState("CapsLock", "T") = 1
- Send {Return}
- else if GetKeyState("CapsLock", "T") = 0
- Send {Blind}{SC032}
- return
- $SC033::Noop("SC033")
- $SC034::Noop("SC034")
- $SC035::Noop("SC035")
- ; =================================
- ; ======== Others ========
- ; =================================
- ; Return on Space key
- $SC039::
- if GetKeyState("CapsLock", "T") = 1
- Send {Return}
- else if GetKeyState("CapsLock", "T") = 0
- Send {Blind}{SC039}
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement