Advertisement
Guest User

Untitled

a guest
Feb 12th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. SetWinDelay,2 ; raise or lower if laggy, 2 default
  6. CoordMode,Mouse
  7.  
  8. Menu, HelpMenu, Add, Exit(Ctrl+Delete), Exit
  9. Menu, HelpMenu, Add, Switch Virtual Desktop(Alt+Mouse5/4), return
  10. Menu, HelpMenu, Add, Volume(Shift+Alt+Up or Down), return
  11. Menu, HelpMenu, Add, Mute(Shift+Alt+Left), return
  12. Menu, HelpMenu, Add, Play/Pause(Shift+Alt+Right), return
  13. Menu, HelpMenu, Add, Slow Spam Left Mouse(Ctrl+Shift), return
  14. Menu, HelpMenu, Add, Spam Left Mouse(Ctrl+Alt), return
  15. Menu, HelpMenu, Add, MEGA Spam Left Mouse(Ctrl+Shift+Alt), return
  16. Menu, HelpMenu, Add, Multi-Clipboard Copy(Ctrl+Shift+NUMBER), return
  17. Menu, HelpMenu, Add, Multi-Clipboard Paster(Ctrl+Alt+NUMBER), return
  18. Menu, HelpMenu, Add, Move`, Resize(Alt+Click&&Drag), return
  19. Menu, HelpMenu, Add, Minimize`, Maximize`, Close(Alt*2+Click), return
  20. Menu, HelpMenu, Add, Borderless Fullscreen(Shift+Alt+F), return
  21. Menu, HelpMenu, Add, Set Window to Always be on Top, return
  22.  
  23.  
  24. Menu, Tray, Add, Hotkeys, :HelpMenu
  25. return
  26.  
  27. return:
  28. return
  29.  
  30. Exit:
  31. ^delete::
  32. send {alt up}
  33. send {ctrl up}
  34. send {win up}
  35. send {shift up}
  36. exitapp
  37. return
  38.  
  39. SwitchR:
  40. !xbutton2:: ;switch virtual desktop, sometimes makes taskbar icons flash
  41. send ^#{right}
  42. return
  43. !xbutton1::
  44. send ^#{left}
  45. return
  46.  
  47. !+up:: Send {Volume_Up}
  48. !+down:: Send {Volume_Down}
  49. !+left:: Send {Volume_Mute}
  50. !+Right:: Send {Media_Play_Pause}
  51.  
  52. $^!+LButton:: ; Ctrl Alt Shift
  53. While GetKeyState("LButton", "P"){
  54.     Click
  55.     Sleep 1
  56. } return
  57. $^!LButton:: ; Ctrl Alt
  58. While GetKeyState("LButton", "P"){
  59.     Click
  60.     Sleep 25
  61. } return
  62. $^+LButton:: ; Ctrl Shift
  63. While GetKeyState("LButton", "P"){
  64.     Click
  65.     Sleep 50
  66. } return
  67.    
  68. fullwindow:
  69. +!f:: ;shift alt f
  70. WinGetTitle, currentWindow, A
  71. IfWinExist %currentWindow%
  72. {
  73.    WinSet, Style, -0x400000 ; hides the dialog frame
  74.    WinSet, Style, -0x40000 ; hides the sizebox/thickframe
  75.    WinSet, Style, -0x800000 ; hides the thin-line border
  76.    WinSet, Style, -0xC00000 ; hides the title bar
  77.    WinSet, top ; move to top
  78.    WinMove, , , 0, 0, 1920, 1080 ; moves the entire window to 0,0 i.e. upper left corner.
  79. } return
  80.  
  81. +!t:: WinSet, top ; Shift Alt t ; move to top
  82. +!a:: Winset, Alwaysontop, , A ;On top of other windows
  83.  
  84. $^+1:: ;ctrl shift 1 ; copies to first clip board, ctrl alt 1 pastes 1st clipboard
  85. windowsclipboard := clipboard ; make sure win clipboard is persistent
  86. send ^c
  87. sleep 100
  88. clip1 := clipboard ; ahk clipboard
  89. clipboard := windowsclipboard ; make sure win clipboard is persistent
  90. return
  91. $^+2::
  92. windowsclipboard := clipboard
  93. send ^c
  94. sleep 100
  95. clip2 := clipboard
  96. clipboard := windowsclipboard
  97. return
  98. $^+3::
  99. windowsclipboard := clipboard
  100. send ^c
  101. sleep 100
  102. clip3 := clipboard
  103. clipboard := windowsclipboard
  104. return
  105. $^+4::
  106. windowsclipboard := clipboard
  107. send ^c
  108. sleep 100
  109. clip4 := clipboard
  110. clipboard := windowsclipboard
  111. return
  112. $^+5::
  113. windowsclipboard := clipboard
  114. send ^c
  115. sleep 100
  116. clip5 := clipboard
  117. clipboard := windowsclipboard
  118. return
  119. $^+6::
  120. windowsclipboard := clipboard
  121. send ^c
  122. sleep 100
  123. clip6 := clipboard
  124. clipboard := windowsclipboard
  125. return
  126. $^+7::
  127. windowsclipboard := clipboard
  128. send ^c
  129. sleep 100
  130. clip7 := clipboard
  131. clipboard := windowsclipboard
  132. return
  133. $^+8::
  134. windowsclipboard := clipboard
  135. send ^c
  136. sleep 100
  137. clip8 := clipboard
  138. clipboard := windowsclipboard
  139. return
  140. $^+9::
  141. windowsclipboard := clipboard
  142. send ^c
  143. sleep 100
  144. clip9 := clipboard
  145. clipboard := windowsclipboard
  146. return
  147. $^+0::
  148. windowsclipboard := clipboard
  149. send ^c
  150. sleep 100
  151. clip0 := clipboard
  152. clipboard := windowsclipboard
  153. return
  154. $^!1:: ;ctrl alt 1
  155. sendraw % clip1 ; send +t+e+x+t instead of TEXT
  156. return
  157. $^!2::
  158. sendraw % clip2
  159. return
  160. $^!3::
  161. sendraw % clip3
  162. return
  163. $^!4::
  164. sendraw % clip4
  165. return
  166. $^!5::
  167. sendraw % clip5
  168. return
  169. $^!6::
  170. sendraw % clip6
  171. return
  172. $^!7::
  173. sendraw % clip7
  174. return
  175. $^!8::
  176. sendraw % clip8
  177. return
  178. $^!9::
  179. sendraw % clip9
  180. return
  181. $^!0::
  182. sendraw % clip0
  183. return
  184.  
  185. ;  Alt + Left Button  : Drag to move a window.
  186. ;  Alt + Right Button : Drag to resize a window.
  187. ;  Double-Alt + Left Button   : Minimize a window.
  188. ;  Double-Alt + Right Button  : Maximize/Restore a window.
  189. ;  Double-Alt + Middle Button : Close a wialtndow.
  190.  
  191. #if GetKeyState("ScrollLock", "T") = 0 ; only move windows if scroll lock is on
  192. $!LButton::
  193. If DoubleAlt
  194. {
  195.     MouseGetPos,,,KDE_id
  196.     PostMessage,0x112,0xf020,,,ahk_id %KDE_id% ; This message is mostly equivalent to WinMinimize, but it avoids a bug with PSPad.
  197.     DoubleAlt := false
  198.     return
  199. }
  200. MouseGetPos,KDE_X1,KDE_Y1,KDE_id ; Get the initial mouse position and window id, and abort if the window is maximized.
  201. WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
  202. If KDE_Win
  203.     return
  204. WinGetPos,KDE_WinX1,KDE_WinY1,,,ahk_id %KDE_id% ; Get the initial window position.
  205. Loop
  206. {
  207.     GetKeyState,KDE_Button,LButton,P ; Break if button has been released.
  208.     If KDE_Button = U
  209.         break
  210.     MouseGetPos,KDE_X2,KDE_Y2 ; Get the current mouse position.
  211.     KDE_X2 -= KDE_X1 ; Obtain an offset from the initial mouse position.
  212.     KDE_Y2 -= KDE_Y1
  213.     KDE_WinX2 := (KDE_WinX1 + KDE_X2) ; Apply this offset to the window position.
  214.     KDE_WinY2 := (KDE_WinY1 + KDE_Y2)
  215.     WinMove,ahk_id %KDE_id%,,%KDE_WinX2%,%KDE_WinY2% ; Move the window to the new position.
  216. }
  217. return
  218.  
  219. $!RButton::
  220. If DoubleAlt
  221. {
  222.     MouseGetPos,,,KDE_id ; Toggle between maximized and restored state.
  223.     WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
  224.     If KDE_Win
  225.         WinRestore,ahk_id %KDE_id%
  226.     Else
  227.         WinMaximize,ahk_id %KDE_id%
  228.     DoubleAlt := false
  229.     return
  230. }
  231. MouseGetPos,KDE_X1,KDE_Y1,KDE_id ; Get the initial mouse position and window id, and abort if the window is maximized.
  232. WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
  233. If KDE_Win
  234.     return
  235. WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id% ; Get the initial window position and size.
  236. If (KDE_X1 < KDE_WinX1 + KDE_WinW / 2) ; Define the window region the mouse is currently in. The four regions are Up and Left, Up and Right, Down and Left, Down and Right.
  237.     KDE_WinLeft := 1
  238. Else
  239.     KDE_WinLeft := -1
  240. If (KDE_Y1 < KDE_WinY1 + KDE_WinH / 2)
  241.     KDE_WinUp := 1
  242. Else
  243.     KDE_WinUp := -1
  244. Loop
  245. {
  246.     GetKeyState,KDE_Button,RButton,P ; Break if button has been released.
  247.     If KDE_Button = U
  248.         break
  249.     MouseGetPos,KDE_X2,KDE_Y2 ; Get the current mouse position.
  250.     WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id% ; Get the current window position and size.
  251.     KDE_X2 -= KDE_X1 ; Obtain an offset from the initial mouse position.
  252.     KDE_Y2 -= KDE_Y1 ; Then, act according to the defined region.
  253.     WinMove,ahk_id %KDE_id%,, KDE_WinX1 + (KDE_WinLeft+1)/2*KDE_X2  ; X of resized window
  254.                             , KDE_WinY1 +   (KDE_WinUp+1)/2*KDE_Y2  ; Y of resized window
  255.                             , KDE_WinW  -     KDE_WinLeft  *KDE_X2  ; W of resized window
  256.                             , KDE_WinH  -       KDE_WinUp  *KDE_Y2  ; H of resized window
  257.     KDE_X1 := (KDE_X2 + KDE_X1) ; Reset the initial position for the next iteration.
  258.     KDE_Y1 := (KDE_Y2 + KDE_Y1)
  259. }
  260. return
  261.  
  262. $!MButton::
  263. If DoubleAlt
  264. {
  265.     MouseGetPos,,,KDE_id
  266.     WinClose,ahk_id %KDE_id%
  267.     DoubleAlt := false
  268.     return
  269. }
  270. return
  271.  
  272. ~Alt:: ; This detects "double-clicks" of the alt key.
  273. DoubleAlt := A_PriorHotkey = "~Alt" AND A_TimeSincePriorHotkey < 400
  274. Sleep 0
  275. KeyWait Alt  ; This prevents the keyboard's auto-repeat feature from interfering.
  276. return
  277. #if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement