Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- SetWinDelay,2 ; raise or lower if laggy, 2 default
- CoordMode,Mouse
- ; 12 February 2019
- Menu, HelpMenu, Add, Exit(Ctrl+Delete), Exit
- Menu, HelpMenu, Add, Switch Virtual Desktop(Alt+Mouse5/4), return
- Menu, HelpMenu, Add, Volume(Shift+Alt+Up or Down), return
- Menu, HelpMenu, Add, Mute(Shift+Alt+Left), return
- Menu, HelpMenu, Add, Play/Pause(Shift+Alt+Right), return
- Menu, HelpMenu, Add, Slow Spam Left Mouse(Ctrl+Shift), return
- Menu, HelpMenu, Add, Spam Left Mouse(Ctrl+Alt), return
- Menu, HelpMenu, Add, MEGA Spam Left Mouse(Ctrl+Shift+Alt), return
- Menu, HelpMenu, Add, Multi-Clipboard Copy(Ctrl+Shift+NUMBER), return
- Menu, HelpMenu, Add, Multi-Clipboard Paster(Ctrl+Alt+NUMBER), return
- Menu, HelpMenu, Add, Move`, Resize(Alt+Click&&Drag&&Scroll Lock Off), return
- Menu, HelpMenu, Add, Minimize`, Maximize`, Close(Alt*2+Click), return
- Menu, HelpMenu, Add, Borderless Fullscreen(Shift+Alt+F), return
- Menu, HelpMenu, Add, Set Window to Always be on Top, return
- Menu, Tray, Add, Features, :HelpMenu ; must define a menu's contents before adding it for some reason
- Msgbox, 0, Quick Windows Shortcuts, Version 0.3 By Asher Finendale`n`nAfinendale35@gmail.com, 1.5
- return
- return:
- return
- Exit:
- ^delete::
- send {alt up}
- send {ctrl up}
- send {win up}
- send {shift up}
- exitapp
- return
- SwitchR:
- !xbutton2:: ;switch virtual desktop, sometimes makes taskbar icons flash
- send ^#{right}
- return
- !xbutton1::
- send ^#{left}
- return
- !+up:: Send {Volume_Up}
- !+down:: Send {Volume_Down}
- !+left:: Send {Volume_Mute}
- !+Right:: Send {Media_Play_Pause}
- $^!+LButton:: ; Ctrl Alt Shift
- While GetKeyState("LButton", "P"){
- Click
- Sleep 1
- } return
- $^!LButton:: ; Ctrl Alt
- While GetKeyState("LButton", "P"){
- Click
- Sleep 25
- } return
- $^+LButton:: ; Ctrl Shift
- While GetKeyState("LButton", "P"){
- Click
- Sleep 50
- } return
- fullwindow:
- +!f:: ;shift alt f
- WinGetTitle, currentWindow, A
- IfWinExist %currentWindow%
- {
- WinSet, Style, -0x400000 ; hides the dialog frame
- WinSet, Style, -0x40000 ; hides the sizebox/thickframe
- WinSet, Style, -0x800000 ; hides the thin-line border
- WinSet, Style, -0xC00000 ; hides the title bar
- WinSet, top ; move to top
- WinMove, , , 0, 0, 1920, 1080 ; moves the entire window to 0,0 i.e. upper left corner.
- } return
- +!t:: WinSet, top ; Shift Alt t ; move to top
- +!a:: Winset, Alwaysontop, , A ;On top of other windows
- $^+1:: ;ctrl shift 1 ; copies to first clip board, ctrl alt 1 pastes 1st clipboard
- windowsclipboard := clipboard ; make sure win clipboard is persistent
- send ^c
- sleep 100
- clip1 := clipboard ; ahk clipboard
- clipboard := windowsclipboard ; make sure win clipboard is persistent
- return
- $^+2::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip2 := clipboard
- clipboard := windowsclipboard
- return
- $^+3::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip3 := clipboard
- clipboard := windowsclipboard
- return
- $^+4::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip4 := clipboard
- clipboard := windowsclipboard
- return
- $^+5::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip5 := clipboard
- clipboard := windowsclipboard
- return
- $^+6::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip6 := clipboard
- clipboard := windowsclipboard
- return
- $^+7::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip7 := clipboard
- clipboard := windowsclipboard
- return
- $^+8::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip8 := clipboard
- clipboard := windowsclipboard
- return
- $^+9::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip9 := clipboard
- clipboard := windowsclipboard
- return
- $^+0::
- windowsclipboard := clipboard
- send ^c
- sleep 100
- clip0 := clipboard
- clipboard := windowsclipboard
- return
- $^!1:: ;ctrl alt 1
- sendraw % clip1 ; send +t+e+x+t instead of TEXT
- return
- $^!2::
- sendraw % clip2
- return
- $^!3::
- sendraw % clip3
- return
- $^!4::
- sendraw % clip4
- return
- $^!5::
- sendraw % clip5
- return
- $^!6::
- sendraw % clip6
- return
- $^!7::
- sendraw % clip7
- return
- $^!8::
- sendraw % clip8
- return
- $^!9::
- sendraw % clip9
- return
- $^!0::
- sendraw % clip0
- return
- ; Alt + Left Button : Drag to move a window.
- ; Alt + Right Button : Drag to resize a window.
- ; Double-Alt + Left Button : Minimize a window.
- ; Double-Alt + Right Button : Maximize/Restore a window.
- ; Double-Alt + Middle Button : Close a wialtndow.
- #if GetKeyState("ScrollLock", "T") = 0 ; only move windows if scroll lock is on
- $!LButton::
- If DoubleAlt
- {
- MouseGetPos,,,KDE_id
- PostMessage,0x112,0xf020,,,ahk_id %KDE_id% ; This message is mostly equivalent to WinMinimize, but it avoids a bug with PSPad.
- DoubleAlt := false
- return
- }
- MouseGetPos,KDE_X1,KDE_Y1,KDE_id ; Get the initial mouse position and window id, and abort if the window is maximized.
- WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
- If KDE_Win
- return
- WinGetPos,KDE_WinX1,KDE_WinY1,,,ahk_id %KDE_id% ; Get the initial window position.
- Loop
- {
- GetKeyState,KDE_Button,LButton,P ; Break if button has been released.
- If KDE_Button = U
- break
- MouseGetPos,KDE_X2,KDE_Y2 ; Get the current mouse position.
- KDE_X2 -= KDE_X1 ; Obtain an offset from the initial mouse position.
- KDE_Y2 -= KDE_Y1
- KDE_WinX2 := (KDE_WinX1 + KDE_X2) ; Apply this offset to the window position.
- KDE_WinY2 := (KDE_WinY1 + KDE_Y2)
- WinMove,ahk_id %KDE_id%,,%KDE_WinX2%,%KDE_WinY2% ; Move the window to the new position.
- }
- return
- $!RButton::
- If DoubleAlt
- {
- MouseGetPos,,,KDE_id ; Toggle between maximized and restored state.
- WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
- If KDE_Win
- WinRestore,ahk_id %KDE_id%
- Else
- WinMaximize,ahk_id %KDE_id%
- DoubleAlt := false
- return
- }
- MouseGetPos,KDE_X1,KDE_Y1,KDE_id ; Get the initial mouse position and window id, and abort if the window is maximized.
- WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
- If KDE_Win
- return
- WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id% ; Get the initial window position and size.
- 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.
- KDE_WinLeft := 1
- Else
- KDE_WinLeft := -1
- If (KDE_Y1 < KDE_WinY1 + KDE_WinH / 2)
- KDE_WinUp := 1
- Else
- KDE_WinUp := -1
- Loop
- {
- GetKeyState,KDE_Button,RButton,P ; Break if button has been released.
- If KDE_Button = U
- break
- MouseGetPos,KDE_X2,KDE_Y2 ; Get the current mouse position.
- WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id% ; Get the current window position and size.
- KDE_X2 -= KDE_X1 ; Obtain an offset from the initial mouse position.
- KDE_Y2 -= KDE_Y1 ; Then, act according to the defined region.
- WinMove,ahk_id %KDE_id%,, KDE_WinX1 + (KDE_WinLeft+1)/2*KDE_X2 ; X of resized window
- , KDE_WinY1 + (KDE_WinUp+1)/2*KDE_Y2 ; Y of resized window
- , KDE_WinW - KDE_WinLeft *KDE_X2 ; W of resized window
- , KDE_WinH - KDE_WinUp *KDE_Y2 ; H of resized window
- KDE_X1 := (KDE_X2 + KDE_X1) ; Reset the initial position for the next iteration.
- KDE_Y1 := (KDE_Y2 + KDE_Y1)
- }
- return
- $!MButton::
- If DoubleAlt
- {
- MouseGetPos,,,KDE_id
- WinClose,ahk_id %KDE_id%
- DoubleAlt := false
- return
- }
- return
- ~Alt:: ; This detects "double-clicks" of the alt key.
- DoubleAlt := A_PriorHotkey = "~Alt" AND A_TimeSincePriorHotkey < 400
- Sleep 0
- KeyWait Alt ; This prevents the keyboard's auto-repeat feature from interfering.
- return
- #if ; end of #if scroll lock
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement