Share Pastebin
Guest
Public paste!

dekz

By: a guest | Jun 4th, 2009 | Syntax: C | Size: 1.24 KB | Hits: 131 | Expires: Never
Copy text to clipboard
  1. ;AutoHotkey
  2. ;CapsLock "mode"
  3. ;if caps lock is down it will act as if it is in edit mode, FPS style
  4. ;by dekz
  5.  
  6. $w::
  7. GetKeyState, state, CapsLock, T
  8. if state = D
  9.   Send,{Up}
  10. else
  11.   Send w
  12. return
  13.  
  14. $a::
  15. GetKeyState, state, CapsLock, T
  16. if state = D
  17.   Send,{Left}
  18. else
  19.   Send a
  20. return
  21.  
  22. $s::
  23. GetKeyState, state, CapsLock, T
  24. if state = D
  25.   Send,{Down}
  26. else
  27.   Send s
  28. return
  29.  
  30. $d::
  31. GetKeyState, state, CapsLock, T
  32. if state = D
  33.   Send,{Right}
  34. else
  35.   Send d
  36. return
  37.  
  38. ;comment line C style
  39. $f::
  40. GetKeyState, state, CapsLock, T
  41. if state = D
  42. {
  43.   Send,{Home}
  44.   Send,{NumPadDiv}
  45.   Send,{NumPadDiv}  
  46. }
  47. else
  48.   Send f
  49. return
  50.  
  51. ;Remove line
  52. $r::
  53. GetKeyState, state, CapsLock, T
  54. if state = D
  55. {
  56.   Send,{Home}
  57.   Send,{shift down}{End}{shift up}
  58.   Send,{Delete}  
  59. }
  60. else
  61.   Send r
  62. return
  63.  
  64. ;Home
  65. $q::
  66. GetKeyState, state, CapsLock, T
  67. if state = D
  68. {
  69.   Send,{Homes}
  70. }
  71. else
  72.   Send q
  73. return
  74.  
  75. ;End
  76. $e::
  77. GetKeyState, state, CapsLock, T
  78. if state = D
  79. {
  80.   Send,{End}
  81. }
  82. else
  83.   Send e
  84. return
  85.  
  86. ;Page Up
  87. $z::
  88. GetKeyState, state, CapsLock, T
  89. if state = D
  90. {
  91.   Send,{PgUp}
  92. }
  93. else
  94.   Send z
  95. return
  96.  
  97.  
  98. ;Page Down
  99. $x::
  100. GetKeyState, state, CapsLock, T
  101. if state = D
  102. {
  103.   Send,{PgDn}
  104. }
  105. else
  106.   Send x
  107. return