Code: Select all
;;;;;;;Check if mouse button has been double clicked
DoubleClick() {
KeyWait, %A_ThisHotkey%
Sleep, 10
KeyWait, %A_ThisHotkey%, D, T0.1
if (ErrorLevel = 0) {
Return True
}
else {
Return False
}
}
;;;;;;;;;;;;Mouse over a window or program
MouseIsOver(WinTitle) {;To get know the correct WinTitle needed use a message box displaying the result of "Win" returned by MouseGetPos
MouseGetPos,,,, Win
if(Win = WinTitle) {
Return true
}
else {
Return false
}
}
;;;;;;;;;;;;;;;If mouse is over taskbar
#If MouseIsOver("MSTaskListWClass1")
;;;;;;;;;;;;;;;;;;;;Middle click over taskbar closes window
MButton::
MouseClick, Right
Sleep, 100
Send {Up}
Send {Enter}
Return
;;;;;;;;;;;;;;;;;;;;Scrolling over taskbar adjusts volume
WheelUp::
Send {Volume_Up}
Return
WheelDown::
Send {Volume_Down}
Return
#If
;;;;;;;;;;;;;;;If mouse is over Chrome
#If MouseIsOver("Chrome_RenderWidgetHostHWND1")
RButton::
;;;;;;;;;;;;Holding click for 0.3 second reopens previously closed tab
KeyWait, RButton, U T0.3
if (ErrorLevel = 1) {
Send, {LCtrl Down}{LShift Down}t{LShift Up}{LCtrl Up}
}
;;;;;;;;;;;;;Double click opens new tab
else if(DoubleClick()) {
Sleep, 150
Send {Esc}
Send ^{t}
}
;;;;;;;;;;;;;;;Single click sends single click
else {
Click, right
}
return
MButton::
;;;;;;;;;;;;;;;Right click and middle click sends password
if (GetKeyState("RButton", "P")){
SendInput password
Send {Enter}
}
;;;;;;;;;;;;;;;Single click sends single click
else {
Send {MButton}
}
Return
#If
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Right click plus left click opens Z (a folder)
~RButton & LButton::
Run, "Z:"
WinActivate, Z (Z:)
WinWaitActive, Z (Z:)
WinMaximize, Z (Z:)
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Left click plus right click opens Chrome
~LButton & RButton::
Run, "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Google Chrome"
WinActivate, New tab - Google Chrome
WinWaitActive, New tab - Google Chrome
WinMaximize, New tab - Google Chrome
Return
;;;;;;;;;;;;;;;;;;;;;;;ScrLk imputs [email protected]
ScrollLock::
SendInput [email protected]
Return
;;;;;;;;;;;;;;;;;;;;;;PScrLk imputs [email protected]
Pause::
SendInput [email protected]
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ImpPnt saves a screenshot as a png file
PrintScreen::
Send !{PrintScreen}
Run, "%windir%\system32\mspaint.exe"
WinActivate, Untitled - Paint
WinWaitActive, Untitled - Paint
Send ^{v}
Send ^{s}
Random, rand, 1, 100
Send %rand%
Send {Enter}
Send !{F4}
Return