; ahk-assistant
; ^ctrl #win !alt +shift
; environment
#NoEnv
#SingleInstance,Force
CoordMode,Mouse
SetWorkingDir %A_MyDocuments%\..\
ProgramFilesX86 := A_ProgramFiles . (A_PtrSize=8 ? " (x86)" : "") ; pfx86 variable from http://www.autohotkey.com/board/topic/79160-a-programfiles-for-programs-in-windows-7-x86-directory/
SetWinDelay,0
SetKeyDelay,0
SetControlDelay,0
SetCapsLockState, AlwaysOff
SetScrollLockState, AlwaysOff
SetNumLockState, AlwaysOn
SetTimer, changeReload, 1000
Menu, Tray, Icon, %A_ScriptDir%\ahk-assistant.ico ; tray icon
#Include, *i %A_ScriptDir%\variables.ahk ; include physical and ip address completions, only included if exists. See .gitignore for details
#Include, *i %A_ScriptDir%\buggy_mouse.ahk ; r.secsrv.net/AutoHotkey/Scripts/Buggy-Mouse super useful for my logitech m570, only included if exists
; global hotkeys
#q::Run notepad
^q::Send !{F4} ; quit most programs
#+q::Run wordpad
#w::Run firefox
#+w::Run firefox.exe -private-window
#e::dirWorking()
#+e::dirSync()
^!e::Run ::{20d04fe0-3aea-1069-a2d8-08002b30309d} ; my computer
^!r::Run mstsc ; remote desktop connection
^!+r::mstscSpecific() ; remote desktop to a destination defined by variable file
#t::launchTerminal() ; useful terminal
#+t::Run cmd ; less useful terminal
^!t::pasteTelephone()
#p::Run "%ProgramFilesX86%\PuTTY\putty.exe" ; putty
#Enter::dialTelephone()
#+Enter::searchCustomer()
*CapsLock::BackSpace
^!k::Run "%A_MyDocuments%\..\Vault\docs\keepass\KeePass.exe"
#\::SendMessage 0x112, 0xF170, 2, , Program Manager ; W-\ - screen standby
^!\::DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0) ; C-A-\ - system standby
#c::Run calc
^!v::Run %ProgramFilesX86%\TightVNC\tvnviewer.exe
^+v::pasteClipboard()
^!m::ControlSend, , {Space}, ahk_exe mpv.exe ; global hotkey to toggle mpv pause/play
^!Space::toggleAudioDevice()
RAlt & j::ShiftAltTab
RAlt & k::AltTab
RAlt & PgUp::Send {WheelUp}
RAlt & PgDn::Send {WheelDown}
SC029::Send, 0 ; Backtick send zeroes
+SC029::Send, `` ; S-Backtick send backticks
^SC029::Send, `� ; C-Backtick send negations
!^0::Send {Volume_Mute} ; C-A-0 volume mute toggle
!^-::Send {Volume_Down 3} ; C-A-- volume down
!^=::Send {Volume_Up 3} ; C-A-+ volume up
XButton1::Send {Click 2} ; remap logitech m570 x1 to double click
XButton2::Send {MButton} ; remap logitech m570 x2 to wheel click
Insert::appendClipboard()
#LButton::WinSet, Style, -0x840000, A ; W-Click - remove window borders
^!+Up::changeResolution(1920,1080) ; change screen resolution native 1080p
^!+Down::changeResolution(1280,720) ; change screen res low-res 720p
!LButton::kdeMove() ; kde style window moving
!RButton::kdeResize() ; kde style window resizing
#Up::WinMaximize, A ; maximise
#Down::WinMinimize, A ; minimise
#+Down::Send !{Esc} ; Send to bottom instead of minimise
#Left::Tile("L") ; left
#Right::Tile("R") ; right
#Numpad1::Tile("BL") ; bottom left
#Numpad2::Tile("B") ; bottom 50%
#Numpad3::Tile("BR") ; bottom right
#Numpad4::Tile("L") ; left
#Numpad5::WinMaximize, A ; maximise window
#NumpadClear::WinSet, AlwaysOnTop, , A ; W-S-Num5 toggles current window to always on top
#Numpad6::Tile("R") ; right
#Numpad7::Tile("TL") ; top left
#Numpad8::Tile("T") ; top 50%
#Numpad9::Tile("TR") ; top right
#Numpad0::winSplit() ; W-num0 tile windows vertically
#NumpadIns::winSplitH() ; W-S-num0 tile windows horizontally
; application specific hotkeys
#IfWinActive ahk_class #32770 ; misc save/load/time-date/find boxes and more!
CapsLock::Send !{F4} ; quit
F1:: ; overflow to rename, help is useless in explorer
F2::explorerRename() ; rename commands
/::Send, \ ; forward slashes paths aren't accepted
!/::Send, / ; just in case you need an incorrect slash
#IfWinActive
#IfWinActive ahk_class CabinetWClass ; explorer
CapsLock::explorerUp()
Alt & Enter:: ; overflow
Ralt & Enter::Send {AppsKey}{Up}{Enter} ; ralt-enter properties
^Enter::explorerSplit()
^+Enter::Send {AppsKey}{Down 2}{Enter} ; C-S enter opens in new window
F1:: ; overflow to rename, help is useless in explorer
F2::explorerRename() ; rename commands
F3::explorerCMD()
F6::Send !d ; addressbar
^Backspace::Send ^+{Left}{Backspace} ; backspace a word
^f::Return ; disable search in explorer, was always pretty useless
^h::explorerHidden()
^+n::explorerNewDir()
^!+n::explorerNewFile()
^p::Send, !p ; C-p also works for toggle preview
^s::Send !vb ; view > status bar
^0::Send !vd ; view > details
^-::Send ^{WheelDown 2} ; zoom out
^=::Send ^{WheelUp 2} ; zoom in
#IfWinActive
#IfWinActive ahk_class ShockwaveFlashFullScreen ; full screen flash
Ralt & Enter:: ; overflow
Alt & Enter::toggleFullscreen() ; leave flash full screen with a keyboard command
#IfWinActive
#IfWinActive ahk_class FontViewWClass ; font previewer
CapsLock::Send !{F4} ; quit
#IfWinActive
#IfWinActive ahk_class SciCalc ; windows xp calc
CapsLock::Send !{F4}