-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPowerpointFocus.ahk
50 lines (39 loc) · 1000 Bytes
/
PowerpointFocus.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
38
39
40
41
42
43
44
45
46
47
48
49
50
#Requires AutoHotkey v2.0
#SingleInstance Force
SetTitleMatchMode(2)
; Declare globals
global SCREEN_CLASS := "ahk_class screenClass"
global POWERPOINT_CLASS := "PowerPoint Presenter View"
try {
; Attempt to get the window title of the active PowerPoint window
isPowerPointActive() {
return WinExist(SCREEN_CLASS) && WinExist(POWERPOINT_CLASS)
}
; Only applies the modifications if PowerPoint is active
#HotIf isPowerPointActive()
; Down Arrow - Advance slide or start presenting from the first slide
*Down:: {
ControlSend("{PgDn}", POWERPOINT_CLASS)
return
}
; Up Arrow - Go back one slide
*Up:: {
ControlSend("{PgUp}", POWERPOINT_CLASS)
return
}
; Ignore Volume Up
*Volume_Up:: {
return
}
; Ignore Volume Down
*Volume_Down:: {
return
}
; Ignore Tab
*Tab:: {
return
}
#HotIf
} catch error {
MsgBox("An error occurred: " error.Message)
}