Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ============== DELETE KEY CLOSE WINDOWS ===============
- SetTitleMatchMode, 2
- #ifWinActive, VLC
- Del::
- #IfWinActive, Bkav
- Del::WinClose, a
- return
- #ifWinActive
- ; ============== MISC KEY ===============
- ~lwin::
- if (A_PriorHotkey <> "~lwin" or A_TimeSincePriorHotkey > 400)
- {
- KeyWait, lwin
- return
- }
- run C:\Users\Fiong\Desktop\Prgrms
- return
- ~rwin::
- if (A_PriorHotkey <> "~rwin" or A_TimeSincePriorHotkey > 600)
- {
- KeyWait, rwin
- return
- }
- send, !{tab}
- return
- Insert::^a
- return
- ; ================ MACRO ===================
- :*:nl::NULL
- return
- ; ============== WINDOWS CLASS ==============
- +#q::
- WinGetClass, class, A
- MsgBox, The active window's class is "%class%".
- return
- ; ============= KUGOU ================
- ; Turn off advertisment
- ^+k::
- MouseMove, 1100, 700, 10
- return
- ; ===================== CHROME ======================
- SetTitleMatchMode, 2
- #ifWinActive, Chrome
- Appskey::^s
- return
- #ifWinActive
- ; ======================= VISUAL STUDIO =====================
- ; ======================= SCROLL LOCK ======================
- SetScrollLockState, On ;Turn SLock on at windows startup
- return
- ;https://autohotkey.com/docs/commands/SetNumScrollCapsLockState.htm
- #If GetKeyState("ScrollLock", "T")
- ~pause::Media_Play_Pause
- return
- NumpadIns::Media_Play_Pause
- return
- NumpadDel::Media_Stop
- return
- NumpadDiv::media_prev
- return
- NumpadMult::media_next
- return
- #If
- ; ================== GENERAL =====================
- ; Empty trash
- ; Source: (#8) https://www.maketecheasier.com/favorite-autohotkey-scripts/
- #Del::FileRecycleEmpty ; win + del
- return
- ; Always on Top
- ^SPACE:: Winset, Alwaysontop, , A ; ctrl + space
- Return
- ; ================== MOUSE KEY MODIFIED ===================
- ;MButton::send, ^a
- ; ======================= DESKTOP PROGRAM FOLDER ========================
- #IfWinActive, Prgrms ahk_exe explorer.exe
- $LButton::
- WinGet, ID, ID, A
- Click, 1
- Send, {enter}
- WinClose, ahk_id %ID%
- return
- #IfWinActive
- #+d::run shell:desktop
- return
- ; ======================= FOLDER MIN MAX ========================
- #IfWinActive ahk_class CabinetWClass
- ]::
- send, #{up}
- return
- [::
- send, #{down}
- return
- /::
- send, #m
- return
- #IfWinActive
- #+down::WinMinimize, A
- return
- ; ================================== HIDE TASKBAR =====================================
- ; https://autohotkey.com/board/topic/83594-how-to-hide-taskbar-with-hotkey/
- #SingleInstance Force
- #t:: ; Alt+T Hotkey
- WinExist("ahk_class Shell_TrayWnd")
- ControlGetPos,,,, hTB, ahk_class Shell_TrayWnd ; Get Taskbar Height
- t := !t ; Toggle Var (0 or 1)
- VarSetCapacity(area, 16)
- WinGetActiveStats, AT, AW, AH, AX, AY ; Get Active Window Stats
- If (t = "1") ; Hide
- {
- Top := A_ScreenHeight
- WinHide, ahk_class Shell_TrayWnd ; Hide Taskbar
- WinHide, Start ahk_class Button ; Hide Start Button
- WinMove, %AT%,,,0,, %A_ScreenHeight% ; Increase Active Window's Height
- }
- Else ; Show
- {
- Top := A_ScreenHeight - hTB ; Screen Height - Taskbar Height
- WinShow, ahk_class Shell_TrayWnd ; Show Taskbar
- WinShow, Start ahk_class Button ; Show Start Button
- WinMove, %AT%,,,0,, (A_ScreenHeight-hTB) ; Decrease Active Window's Height
- }
- DllCall("ntoskrnl.exe\RtlFillMemoryUlong", UInt,&area + 0, UInt,4, UInt,0)
- DllCall("ntoskrnl.exe\RtlFillMemoryUlong", UInt,&area + 4, UInt,4, UInt,0)
- DllCall("ntoskrnl.exe\RtlFillMemoryUlong", UInt,&area + 8, UInt,4, UInt,A_ScreenWidth)
- DllCall("ntoskrnl.exe\RtlFillMemoryUlong", UInt,&area + 12,UInt,4, UInt,Top)
- DllCall("SystemParametersInfo", UInt,0x2F, UInt,0, UInt,&area, UInt,0)
- return
- ; Hide task: http://hackerspace.kinja.com/another-late-ahk-script-that-hides-the-taskbar-1701996722
- ; ============================ HIDE DESKTOP ICON =================================
- #h::
- MouseGetPos,,,win
- WinGetClass, class, ahk_id %win%
- If class in Progman,WorkerW
- {
- ControlGet, HWND, Hwnd,, SysListView321, ahk_class Progman
- If HWND =
- ControlGet, HWND, Hwnd,, SysListView321, ahk_class WorkerW
- If DllCall("IsWindowVisible", UInt, HWND)
- WinHide, ahk_id %HWND%
- Else
- WinShow, ahk_id %HWND%
- }
- else
- send, #h
- Return
- ;https://autohotkey.com/board/topic/40217-how-to-check-if-desktop-is-active/
- ;https://autohotkey.com/board/topic/46689-my-first-script-for-hidding-desktop-icons/
- ; Double click
- ~LButton::
- If ( A_PriorHotKey = A_ThisHotKey && A_TimeSincePriorHotkey < 400 ) {
- WinGetClass, Class, A
- If Class in Progman,WorkerW
- var := (flag=0) ? "Show" : "Hide"
- flag := !flag
- Control,%var%,, SysListView321, ahk_class Progman
- Control,%var%,, SysListView321, ahk_class WorkerW
- }
- Return
- ;https://autohotkey.com/board/topic/38006-double-click-desktop-to-hide-icons/
- ;https://autohotkey.com/board/topic/38071-toggle-visibility-of-desktop-icons-by-doubleclicking-desktop/
- ; =================== CREATE TXT ==========================
- #IfWinActive, ahk_class CabinetWClass
- ^+t:: ;If Windows+Shift+T is pressed in Windows Explorer
- Send !f ;> File
- Send w ;> New
- Send t ;select Text Document
- return
- #IfWinActive
- ; ================== CLOSE ALL WINDOWS ====================
- #F4::
- WinGet, id, list, , , Program Manager
- Loop, %id%
- {
- StringTrimRight, this_id, id%a_index%, 0
- WinGetTitle, this_title, ahk_id %this_id%
- winclose,%this_title%
- }
- Return
- ;=========== VIEW MODE =============
- #IfWinActive ahk_class CabinetWClass
- ; alt+3 large icons
- ; alt+7 detail
- !2::Send !v{down 2}{enter}
- !3::Send !v{down 3}{enter}
- !4::send !v{down 4}{enter}
- !6::Send !v{down 6}{enter}
- !7::Send !v{down 7}{enter}
- !8::send !v{down 8}{enter}
- #IfWinActive
- ; ============= Ctrl Backspace ==============
- ; how to write scripts: http://www.autohotkey.com/docs/
- #IfWinActive ahk_class CabinetWClass ; File Explorer
- ^Bs::
- #IfWinActive, ahk_class Notepad
- ^Bs::
- Send ^+{Left}{Backspace}
- return
- #IfWinActive
- SetTitleMatchMode, 2
- #IfWinActive ahk_class XLMAIN
- ^Bs::
- Send ^+{Left}{BS}
- return
- #IfWinActive
- ; source and context: http://superuser.com/a/636973/124606
- ; relevant documentation links:
- ; writing hotkeys
- ; http://www.autohotkey.com/docs/Hotkeys.htm
- ; list of key codes (including Backspace)
- ; http://www.autohotkey.com/docs/KeyList.htm
- ; the #IfWinActive directive
- ; http://www.autohotkey.com/docs/commands/_IfWinActive.htm
- ; the Send command
- ; http://www.autohotkey.com/docs/commands/Send.htm
- ;__________________________________________________
- ; ============= WINDOWS EXIT =============
- ~esc::
- if (A_PriorHotkey <> "~esc" or A_TimeSincePriorHotkey > 400)
- {
- KeyWait, Esc
- return
- }
- send !{f4}
- return
- ~End::
- if (A_PriorHotkey <> "~end" or A_TimeSincePriorHotkey > 400)
- {
- KeyWait, End
- return
- }
- else
- {
- #IfWinActive ahk_class CabinetWClass
- Send, ^w
- return
- #IfWinActive
- Send, ^{f4}
- return
- }
- ~pause::winclose, a
- return
- ; ============= RUN MENU ===============
- #appskey:: run notepad++
- return
- ; ============= EXPLORER NAVIGATION ==============
- #IfWinactive ahk_class CabinetWClass
- #+n::
- Send ^e{Tab}
- Send {Down}ln
- return
- #IfWinactive,
- ; ============= FUNCTIONS ==================
- ~F4::^v
- return
- ^F4::F4
- return
- ~F7::^+Tab
- return
- ~F8::^Tab
- return
- ~F9::send, #{down}
- return
- ~F10::send, #{up}
- return
- ~F12::browser_home
- return
- +F12::
- send, {F12}
- return
- ; ---------- F3 Function -------------
- $F3::
- KeyWait, F3 ; wait for F3 released
- KeyWait, F3, D T0.2 ; wait 1 second for F3 pressed again
- If ErrorLevel ; if 1 second passes before F3 is pressed again
- {
- Send ^c ; or whatever your copy code is
- }
- else ; we will now allow F3 to be pressed normally
- {
- Loop
- {
- Send {F3 down}
- KeyWait, F3 ; wait for F3 release
- Send {F3 up}
- KeyWait, F3, D T1 ; wait 1 second for F3 pressed again
- If ErrorLevel ; if 1 second passes before F3 is pressed again
- Break ; exit his Loop
- }
- }
- return
- ; ------------ F2 function -------------
- ~Shift::
- if (A_PriorHotkey <> "~Shift" or A_TimeSincePriorHotkey > 400)
- {
- ; Too much time between presses, so this isn't a double-press.
- KeyWait, Shift
- return
- }
- send {F2}
- return
- ; =========== POWER ===============
- #F5:: ;turn off monitor
- Sleep, 200
- SendMessage,0x112,0xF170,2,,Program Manager
- return
- #pause:: ;sleep
- DllCall("PowrProf\SetSuspendState", "int", 0, "int", 1, "int", 0)
- return
- !+End:: ;hibernate
- DllCall("PowrProf\SetSuspendState", "int", 1, "int", 0, "int", 0)
- return
- #end:: ;shutdown
- shutdown, 1
- return
- ;============ RUN PROGRAMES ==============
- !+d::run idm514
- return
- !+g:: run chrome
- return
- !+h::run QQPYHandInput
- return
- !+l::run lingoes
- return
- ^!n::run notepad++
- return
- !+n:: run networks
- return
- ; ========== Disable Hotkeys =============
- ^!s::
- suspend
- if (A_IsSuspended)
- {
- TrayTip, Hotkey, Disabled, ,
- }
- else
- {
- TrayTip, Hotkey, Enabled, ,
- }
- return
- ^!p::pause
- return
- ^!r::reload
- return
- ^!e::edit
- return
- ; ============= WINHOTKEYS ==================
- #c::run calc
- return
- #g::run http://translate.google.com/
- #i::run iexplore
- return
- #j::run shell:Downloads
- return
- #o::run D:\USB
- return
- #s:: run devenv
- return
- #w::run winword
- return
- #v::run sndvol
- return
- #x::run excel
- return
- #n::run notepad
- return
- ;============== VOLUME ==================
- !wheelup::
- send {volume_up 10}
- return
- !wheeldown::
- send {volume_down 10}
- return
- !numpaddiv::
- soundset +10
- return
- !numpadmult::
- soundset -10
- return
- ~PrintScreen::
- if (A_PriorHotkey <> "~PrintScreen" or A_TimeSincePriorHotkey > 400)
- {
- ; Too much time between presses, so this isn't a double-press.
- KeyWait, PrintScreen
- return
- }
- send {Volume_Mute}
- return
- ; ============ MOUSE WHELL VOLUME ===================
- ~WheelUp::mouseWheelVolume("+10")
- ~WheelDown::mouseWheelVolume("-10")
- mouseWheelVolume(step)
- { mouseGetPos,mx,my,wnd
- wingetClass,cls,ahk_id %wnd%
- if cls=Shell_TrayWnd
- { SoundSet %step%
- soundSet 0,,mute
- soundGet vol
- ifInString,vol,.
- stringMid,vol,vol,1,% inStr(vol,".")-1
- tooltip, Volume:%vol%`%,% mx+8,% my+8,19
- setTimer removeVolumeTip,2000
- }
- return
- removeVolumeTip:
- tooltip,,,,19
- settimer removeVolumeTip,OFF
- return
- }
- ; ============= MEDIA ==================
- !pgdn::
- send, {media_next}
- return
- !pgup::
- send, {media_prev}
- return
- +pause::
- send {media_stop}
- return
- +volume_down::Volume_Mute
- return
- ; ~printscreen::
- ;GetKeyState, state, ScrollLock, T ; state will be 'D' if ScrollLock is on or 'U' if it is off
- ; if ( state = "U" )
- ; send {volume_mute}
- ;return
Advertisement
Add Comment
Please, Sign In to add comment