-
Notifications
You must be signed in to change notification settings - Fork 0
/
HotKeys.ahk
37 lines (36 loc) · 1.78 KB
/
HotKeys.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#SingleInstance, Force
#NoTrayIcon
;-------------------------------------------------------------------------------
^Space::WinSet, AlwaysOnTop, Toggle, A
;-------------------------------------------------------------------------------
^#c::Run, % A_ComSpec " /K cd /d " CurrentFolder(), , UseErrorLevel
^+#c::Run, % "*Runas " A_ComSpec " /K cd /d " CurrentFolder(), , UseErrorLevel
^#p::Run, % A_ComSpec " /K cd /d " CurrentFolder() " && Powershell", , UseErrorLevel
^+#p::Run, % "*Runas " A_ComSpec " /K cd /d " CurrentFolder() " && Powershell", , UseErrorLevel
;-------------------------------------------------------------------------------
^+#z::Run Explorer shell:::{ED7BA470-8E54-465E-825C-99712043E01C} ; all tasks
;-------------------------------------------------------------------------------
; ^#Left::Send, {Media_Prev} ; conflict with switching virtual desktop
; ^#Right::Send, {Media_Next} ; conflict with switching virtual desktop
;-------------------------------------------------------------------------------
^#!Up::Send, {Volume_Up}
^#!Down::Send, {Volume_Down}
^#!Left::Send, {Media_Prev}
^#!Right::Send, {Media_Next}
^#!Space::Send, {Media_Play_Pause}
^#!Enter::Send, {Media_Stop}
;-------------------------------------------------------------------------------
^+#Up::system_SetScreenBrightness(5)
^+#Down::system_SetScreenBrightness(-5)
;===============================================================================
CurrentFolder(hWnd=0) {
If hWnd||(hWnd:=WinExist("ahk_class CabinetWClass"))||(hWnd:=WinExist("ahk_class ExploreWClass"))
{
shell := ComObjCreate("Shell.Application")
Loop, % shell.Windows.Count
If ( (win := shell.Windows.Item(A_Index-1)).hWnd = hWnd )
Break
Return win.Document.Folder.Self.Path
}
Return "D:\"
}