Advertisement
pharmokan

auto hot key ahk laptop thinkpad leonid

Dec 31st, 2019
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.61 KB | None | 0 0
  1. #InstallKeybdHook
  2.  
  3. ;____________________________
  4. ;list of hotkeys
  5. ;____________________________
  6. ;# Win
  7. ;! Alt
  8. ;^ Control
  9. ;+ Shift
  10. ;____________________________
  11. ;include libraries
  12. toggle := 0
  13.  
  14. $Shift::
  15. If GetKeyState("Shift", "P")
  16. {
  17. While GetKeyState("Shift", "P")
  18. Send {Shift Down}
  19. Send {Shift Up}
  20. }
  21. Else
  22. Send {Escape}
  23. return
  24.  
  25. ;chrome
  26. !c::send {LWin Down}2{LWin Up}
  27. ;!c::send {LAlt Down}v{LAlt Up}
  28. ;____________________________
  29.  
  30. ;winscp
  31. !f::send {LWin Down}6{LWin Up}
  32. ;____________________________
  33.  
  34. !v::WinActivate, ahk_class Qt5QWindowIcon
  35. ;vscode
  36. !b::
  37. F14::
  38. send {LWin Down}4{LWin Up}
  39. Return
  40. ;____________________________
  41.  
  42. ^F23::
  43. WinMinimize, A
  44. Return
  45. ;____________________________
  46.  
  47. ;f or j or k or d
  48.  
  49. ; send {BackSpace}
  50. ; send {LCtrl Down}{Tab}{ LCtrl Up}
  51. ; Return
  52.  
  53. ;____________________________
  54. ;j keyf
  55. ;____________________________
  56. #if GetKeyState("j")
  57.  
  58. q::
  59. send {BackSpace}
  60. send {LAlt Down}s{ LAlt Up}
  61. Return
  62. ;____________________________
  63.  
  64. w::
  65. send {BackSpace}
  66. send {LCtrl Down}w{ LCtrl Up}
  67. Return
  68. ;____________________________
  69.  
  70. r::
  71. send {BackSpace}
  72. send {LCtrl Down}r{ LCtrl Up}
  73. Return
  74. ;____________________________
  75.  
  76. -::
  77. 1::
  78. send {BackSpace}
  79. send {LCtrl Down}{LShift Down}{Tab}{LShift Up}{LCtrl Up}
  80. return
  81. ;____________________________
  82.  
  83. =::
  84. 2::
  85. send {BackSpace}
  86. send {LCtrl Down}{Tab}{ LCtrl Up}
  87. Return
  88. ;____________________________
  89.  
  90. g::
  91. send {BackSpace}
  92. send {LAlt Down}h{ LAlt Up}
  93. Return
  94.  
  95. #if
  96. ;end j key
  97.  
  98. ;____________________________
  99. ;e key
  100. ;____________________________
  101.  
  102. #if GetKeyState("e")
  103. ;____________________________
  104.  
  105. 1::
  106. send {LAlt Down}{Left}{ LAlt Up}
  107. Return
  108. ;____________________________
  109.  
  110. 2::
  111. send {LAlt Down}{Right}{ LAlt Up}
  112. Return
  113. ;____________________________
  114.  
  115. Backspace::
  116. send {LCtrl Down}w{ LCtrl Up}
  117. Return
  118.  
  119. #if
  120. ;end e key
  121.  
  122.  
  123. ;____________________________
  124. ;k key
  125. ;____________________________
  126. #if GetKeyState("k")
  127.  
  128. ;____________________________
  129.  
  130. z::
  131. send {BackSpace}
  132. send {LAlt Down}{F4}{ LAlt Up}
  133. Return
  134. ;____________________________
  135.  
  136. q::
  137. send {BackSpace}
  138. send {LAlt Down}s{ LAlt Up}
  139. Return
  140. ;____________________________
  141.  
  142. w::
  143. send {BackSpace}
  144. send {LAlt Down}{LShift Down}s{LShift Up}{ LAlt Up}
  145. Return
  146. ;____________________________
  147.  
  148.  
  149. Tab::
  150. SC027::
  151. send {BackSpace}
  152. send {LCtrl Down}w{ LCtrl Up}
  153. Return
  154. ;____________________________
  155. 3::
  156. send {BackSpace}
  157. send {LAlt Down}3{ LAlt Up}
  158. Return
  159.  
  160. j::
  161. send {BackSpace}
  162. send {LAlt Down}{left}{ LAlt Up}
  163. Return
  164. ;____________________________
  165.  
  166. l::
  167. send {BackSpace}
  168. send {LAlt Down}{right}{ LAlt Up}
  169. Return
  170. ;____________________________
  171.  
  172. t::
  173. send {BackSpace}
  174. send {LCtrl Down}t{ LCtrl Up}
  175. Return
  176. ;____________________________
  177.  
  178. f::
  179. send {BackSpace}
  180. send {LCtrl Down}{f}{ LCtrl Up}
  181. Return
  182. ;____________________________
  183.  
  184. r::
  185. send {BackSpace}
  186. send {LCtrl Down}r{ LCtrl Up}
  187. Return
  188. ;____________________________
  189.  
  190. g::
  191. send {BackSpace
  192. send {LAlt Down}h{ LAlt Up}
  193. Return
  194. ;____________________________
  195.  
  196. d::
  197. send {BackSpace}
  198. send {LAlt Down}d{ LAlt Up}
  199. Return
  200. ;____________________________
  201.  
  202. -::
  203. 1::
  204. send {BackSpace}
  205. send {LAlt Down}1{LAlt Up}
  206. return
  207. ;____________________________
  208.  
  209. =::
  210. 2::
  211. send {BackSpace}
  212. send {LAlt Down}2{LAlt Up}
  213. return
  214. ;____________________________
  215.  
  216. BackSpace::
  217. send {BackSpace}
  218. send {LCtrl Down}{BackSpace}{ LCtrl Up}
  219. Return
  220. ;____________________________
  221.  
  222. c::
  223. send {BackSpace}
  224. send {LCtrl Down}{LShift Down}j{LShift Up}{LCtrl Up}
  225. return
  226. ;____________________________
  227.  
  228. i::
  229. n::
  230. send {BackSpace}
  231. send {LCtrl Down}{LShift Down}c{LShift Up}{LCtrl Up}
  232. return
  233. ;____________________________
  234.  
  235. b::
  236. send {BackSpace}
  237. send {LWin Down}4{LWin Up}
  238. return
  239. ;____________________________
  240.  
  241. m::
  242. send {BackSpace}
  243. WinMinimize, A
  244. Return
  245. ;____________________________
  246.  
  247. #if
  248. ;end k key
  249.  
  250. ^+F23::
  251. WinGet, win_state, MinMax,A
  252. If(win_state == 1)
  253. WinRestore, A
  254. Else If(win_state == 0)
  255. WinMaximize, A
  256. return
  257. ;____________________________
  258.  
  259. F13::
  260. !BackSpace::
  261. CMD()
  262. Return
  263. ;____________________________
  264.  
  265. !e::Explorer()
  266. F15::
  267. toggle := !toggle
  268. if (toggle = 1){
  269. TrayTip Layer 1, KEYBOARD LAYER # 1
  270. sleep 1000
  271. HideTrayTip()
  272. } else {
  273. TrayTip Layer 0, MOUSE LAYER # 0
  274. sleep 1000
  275. HideTrayTip()
  276. }
  277. return
  278. ;____________________________
  279.  
  280.  
  281. HideTrayTip() {
  282. TrayTip ; Attempt to hide it the normal way.
  283. if SubStr(A_OSVersion,1,3) = "10." {
  284. Menu Tray, NoIcon
  285. Sleep 200 ; It may be necessary to adjust this sleep.
  286. Menu Tray, Icon
  287. }
  288. }
  289.  
  290. ;____________________________
  291. ;if chrome window active
  292. ;____________________________
  293. #IfWinActive ahk_class Chrome_WidgetWin_1
  294.  
  295. ^+c::
  296. ^+i::
  297. Return
  298.  
  299. #If
  300.  
  301.  
  302. ;____________________________
  303. ;if picture preview window active
  304. ;____________________________
  305. #IfWinActive ahk_class Photo_Lightweight_Viewer
  306.  
  307. l::Right
  308. ;____________________________
  309.  
  310. j::Left
  311.  
  312. #If
  313.  
  314. ;____________________________
  315. ;if winscp window active
  316. ;____________________________
  317. #IfWinActive, ahk_class TScpExplorerForm
  318. k & r::
  319. send {LCtrl Down}o{ LCtrl Up}
  320. Return
  321. #If
  322.  
  323. ;____________________________
  324. ;if git bash shell active
  325. ;____________________________
  326. #IfWinActive, ahk_class mintty
  327. ^v::
  328. send {LShift Down}{Ins}{LShift Up}
  329. Return
  330. #If
  331.  
  332. ;____________________________
  333. #x::Reload
  334.  
  335. ;____________________________
  336. ;Toggle Window
  337. ;____________________________
  338. ToggleWindow(TheWindowTitle)
  339. {
  340. SetTitleMatchMode,2
  341. DetectHiddenWindows, Off
  342. IfWinActive, %TheWindowTitle%
  343. {
  344. Return
  345. }
  346. Else
  347. {
  348. IfWinExist, %TheWindowTitle%
  349. {
  350. WinActivate
  351. Return true
  352. }
  353.  
  354. Else
  355. {
  356. DetectHiddenWindows, On
  357. {
  358. IfWinExist, %TheWindowTitle%
  359. WinShow
  360. WinActivate
  361. }
  362. Return false
  363. }
  364. }
  365. }
  366. ;____________________________
  367.  
  368. CMD()
  369. {
  370. IfWinActive, ahk_class mintty
  371. WinMinimize, A
  372. Else
  373. WinActivate, ahk_class mintty
  374. Return
  375. }
  376. ;____________________________
  377.  
  378. Explorer()
  379. {
  380. IfWinExist, ahk_class CabinetWClass
  381. WinActivate
  382. Else
  383. Run, Explorer
  384. Return
  385. }
  386. ;____________________________
  387. ;if explorer window active
  388. ;____________________________
  389. #IfWinActive ahk_class CabinetWClass
  390.  
  391. l & 2::
  392. ;____________________________
  393. ; rename
  394. send {F2}
  395. return
  396.  
  397. ;____________________________
  398. ; search
  399. l & 3::
  400. send {F3}
  401. return
  402. ;____________________________
  403.  
  404. l::send {l}
  405. #IfWinActive
  406. ;RButton::Ctrl
  407. ;!RButton::MouseClick, Right
  408.  
  409. !s::WinActivate, ahk_class OWL.DocumentWindow
  410. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement