Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn ; Enable warnings to assist with detecting common errors.
  3. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  5.  
  6. ; =================================
  7. ; ======== Layer functions ========
  8. ; =================================
  9.  
  10. Layered(defaultKey, alterKey)
  11. {
  12. if GetKeyState("CapsLock", "T") = 1
  13. Send {Blind}{%alterKey%}
  14. else if GetKeyState("CapsLock", "T") = 0
  15. Send {Blind}{%defaultKey%}
  16. return
  17. }
  18.  
  19. LayeredControl(defaultKey, alterKey)
  20. {
  21. if GetKeyState("CapsLock", "T") = 1
  22. Send {Blind}{CtrlDown}{%alterKey%}{CtrlUp}
  23. else if GetKeyState("CapsLock", "T") = 0
  24. Send {Blind}{%defaultKey%}
  25. return
  26. }
  27.  
  28. Noop(defaultKey)
  29. {
  30. if GetKeyState("CapsLock", "T") = 1
  31. SoundBeep
  32. else if GetKeyState("CapsLock", "T") = 0
  33. Send {Blind}{%defaultKey%}
  34. return
  35. }
  36.  
  37. ; =================================
  38. ; ======== Digits row ========
  39. ; =================================
  40.  
  41. $SC029::Noop("SC029")
  42. $SC002::Layered("SC002","!")
  43. $SC003::Layered("SC003","""")
  44. $SC004::Layered("SC004","£")
  45. $SC005::Layered("SC005","$")
  46. $SC006::Layered("SC006","%")
  47. $SC007::Layered("SC007","^")
  48. $SC008::Layered("SC008","&")
  49. $SC009::Layered("SC009","*")
  50. $SC00A::Layered("SC00A","(")
  51. $SC00B::Layered("SC00B",")")
  52. $SC00C::Layered("SC00C","_")
  53. $SC00D::Layered("SC00D","+")
  54.  
  55. ; =================================
  56. ; ======== Top row ========
  57. ; =================================
  58.  
  59. $SC010::Layered("SC010", "Esc")
  60.  
  61. ; Ctrl+Shift+Z on W
  62. $SC011::
  63. if GetKeyState("CapsLock", "T") = 1
  64. Send {Blind}^+z
  65. else if GetKeyState("CapsLock", "T") = 0
  66. Send {Blind}{SC011}
  67. return
  68.  
  69. $SC012::Layered("SC012", "Backspace")
  70. $SC013::Layered("SC013", "Del")
  71. $SC014::Layered("SC014", "Insert")
  72. $SC015::Layered("SC015", "PgUp")
  73. $SC016::Layered("SC016", "Home")
  74. $SC017::Layered("SC017", "Up")
  75. $SC018::Layered("SC018", "End")
  76.  
  77. ; AltGr+P on P
  78. $SC019::
  79. if GetKeyState("CapsLock", "T") = 1
  80. Send {Blind}{RAlt Down}p{RAlt Up}
  81. else if GetKeyState("CapsLock", "T") = 0
  82. Send {Blind}{SC019}
  83. return
  84.  
  85. ; =================================
  86. ; ======== Middle row ========
  87. ; =================================
  88.  
  89. $SC01E::LayeredControl("SC01E", "a")
  90. $SC01F::Layered("SC01F", "AltDown")
  91. $SC01F Up::Layered("SC01F Up", "AltUp")
  92. $SC020::Layered("SC020","ShiftDown")
  93. $SC020 Up::Layered("SC020 Up", "ShiftUp")
  94. $SC021::Layered("SC021","CtrlDown")
  95. $SC021 Up::Layered("SC021 Up", "CtrlUp")
  96. $SC022::Layered("SC022","Tab")
  97. $SC023::Layered("SC023","PgDn")
  98. $SC024::Layered("SC024","Left")
  99. $SC025::Layered("SC025","Down")
  100. $SC026::Layered("SC026","Right")
  101. $SC027::Noop("SC027")
  102. $SC028::Noop("SC028")
  103.  
  104.  
  105. ; =================================
  106. ; ======== Bottom row ========
  107. ; =================================
  108.  
  109. $SC02B::Noop("SC02B")
  110. $SC02C::LayeredControl("SC02C", "z")
  111. $SC02D::LayeredControl("SC02D", "x")
  112. $SC02E::LayeredControl("SC02E", "c")
  113. $SC02F::LayeredControl("SC02F", "v")
  114. $SC030::Noop("SC030")
  115. $SC031::LayeredControl("SC031", "Space")
  116.  
  117. ; Return on M key
  118. $SC032::
  119. if GetKeyState("CapsLock", "T") = 1
  120. Send {Return}
  121. else if GetKeyState("CapsLock", "T") = 0
  122. Send {Blind}{SC032}
  123. return
  124.  
  125. $SC033::Noop("SC033")
  126. $SC034::Noop("SC034")
  127. $SC035::Noop("SC035")
  128.  
  129. ; =================================
  130. ; ======== Others ========
  131. ; =================================
  132.  
  133. ; Return on Space key
  134. $SC039::
  135. if GetKeyState("CapsLock", "T") = 1
  136. Send {Return}
  137. else if GetKeyState("CapsLock", "T") = 0
  138. Send {Blind}{SC039}
  139. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement