Guest User

Mouse keys ahk script

a guest
Sep 3rd, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LControl::  ; Make the A key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
  2.  
  3. if  GetKeyState("CapsLock", "T")
  4. {
  5.     Click down
  6.     Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
  7.     {
  8.     ;    if not ( GetKeyState("RAlt", "P") and (GetKeyState("LControl", "P") )  ; If this statement is true, the user has physically released the F1 key.
  9.         if not (GetKeyState("LControl", "P"))    ; If this statement is true, the user has physically released the F1 key.
  10.             break  ; Break out of the loop.
  11.         ; Otherwise (since the above didn't "break"), keep clicking the mouse.
  12.         ;Click down  ; Click the left mouse button at the cursor's current position.
  13.         ;;Wait 10
  14.     }
  15.     Click up
  16. }
  17. else
  18. {
  19.     Send {Lcontrol down}
  20.     Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
  21.     {
  22.     ;    if not ( GetKeyState("RAlt", "P") and (GetKeyState("LControl", "P") )  ; If this statement is true, the user has physically released the F1 key.
  23.         if not (GetKeyState("LControl", "P"))    ; If this statement is true, the user has physically released the F1 key.
  24.             break  ; Break out of the loop.
  25.         ; Otherwise (since the above didn't "break"), keep clicking the mouse.
  26.         ;Click down  ; Click the left mouse button at the cursor's current position.
  27.         ;;Wait 10
  28.     }
  29.     Send {Lcontrol up}
  30. }
  31. return
  32.  
  33.  
  34. ;LControl & RAlt::  ; Make the A key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
  35. LWin::  ; Make the A key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
  36.  
  37. if  GetKeyState("CapsLock", "T")
  38. {
  39.     Click middle, down
  40.     Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
  41.     {
  42.     ;    if not ( GetKeyState("RAlt", "P") and (GetKeyState("LControl", "P") )  ; If this statement is true, the user has physically released the F1 key.
  43.         if not (GetKeyState("LWin", "P"))    ; If this statement is true, the user has physically released the F1 key.
  44.             break  ; Break out of the loop.
  45.         ; Otherwise (since the above didn't "break"), keep clicking the mouse.
  46.         ;Click down  ; Click the left mouse button at the cursor's current position.
  47.         ;;Wait 10
  48.     }
  49.     Click middle, up
  50. }
  51. else
  52. {
  53.     Send {LWin down}
  54.     Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
  55.     {
  56.     ;    if not ( GetKeyState("RAlt", "P") and (GetKeyState("LControl", "P") )  ; If this statement is true, the user has physically released the F1 key.
  57.         if not (GetKeyState("LWin", "P"))    ; If this statement is true, the user has physically released the F1 key.
  58.             break  ; Break out of the loop.
  59.         ; Otherwise (since the above didn't "break"), keep clicking the mouse.
  60.         ;Click down  ; Click the left mouse button at the cursor's current position.
  61.         ;;Wait 10
  62.     }
  63.     Send {LWin up}
  64.     Send {Ctrl}
  65. }
  66. return
  67.  
  68. ;LControl & RAlt::  ; Make the A key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
  69. LAlt::  ; Make the A key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
  70.  
  71. if  GetKeyState("CapsLock", "T")
  72. {
  73.     Click right, down
  74.     Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
  75.     {
  76.     ;    if not ( GetKeyState("RAlt", "P") and (GetKeyState("LControl", "P") )  ; If this statement is true, the user has physically released the F1 key.
  77.         if not (GetKeyState("LAlt", "P"))    ; If this statement is true, the user has physically released the F1 key.
  78.             break  ; Break out of the loop.
  79.         ; Otherwise (since the above didn't "break"), keep clicking the mouse.
  80.         ;Click down  ; Click the left mouse button at the cursor's current position.
  81.         ;;Wait 10
  82.     }
  83.     Click right, up
  84. }
  85. else
  86. {
  87.     Send {LAlt down}
  88.     Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
  89.     {
  90.     ;    if not ( GetKeyState("RAlt", "P") and (GetKeyState("LControl", "P") )  ; If this statement is true, the user has physically released the F1 key.
  91.         if not (GetKeyState("LAlt", "P"))    ; If this statement is true, the user has physically released the F1 key.
  92.             break  ; Break out of the loop.
  93.         ; Otherwise (since the above didn't "break"), keep clicking the mouse.
  94.         ;Click down  ; Click the left mouse button at the cursor's current position.
  95.         ;;Wait 10
  96.     }      
  97.     Send {LAlt up}
  98. }
  99. return
  100.  
  101. /*
  102. $D::  ; Make the A key into a hotkey (the $ symbol facilitates the "P" mode
  103. Click middle, down
  104. Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
  105. {
  106.     if not GetKeyState("D", "P")  ; If this statement is true, the user has physically released the F1 key.
  107.         break  ; Break out of the loop.
  108.     ; Otherwise (since the above didn't "break"), keep clicking the mouse.
  109.     ;Click down  ; Click the left mouse button at the cursor's current position.
  110.     ;;Wait 10
  111. }
  112. Click middle, up
  113. return
  114.  
  115. $F::  ; Make the A key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
  116.  
  117. Click right, down
  118. Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
  119. {
  120.     if not GetKeyState("F", "P")  ; If this statement is true, the user has physically released the F1 key.
  121.         break  ; Break out of the loop.
  122.     ; Otherwise (since the above didn't "break"), keep clicking the mouse.
  123.     ;Click down  ; Click the left mouse button at the cursor's current position.
  124.     ;;Wait 10
  125. }
  126. Click right, up
  127. return
  128. */
Advertisement
Add Comment
Please, Sign In to add comment