-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReCenter.ahk
49 lines (39 loc) · 1.2 KB
/
ReCenter.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
#Requires AutoHotkey v2.0
#include ./Lib/UIA.ahk
WMRBar := false
checkWMRBar() {
if (PixelGetColor(5, 5) != "0x0078d4") {
return
}
WMRBar := true
Send("#y")
Sleep(100)
}
Recenter() {
If !WinExist("Mixed Reality Portal") {
return
}
checkWMRBar()
WinActivate("Mixed Reality Portal")
WMR := UIA.ElementFromHandle("Mixed Reality Portal")
try {
while 1 {
WMR.FindElement({ name: "Back" }).Click()
}
}
if WMR.WaitElement({ name: "Ready" }).Location.w == 0 {
WMR.FindElement({ name: "Expand" }).Click()
}
WMR.WaitElement({ name: "Set up room boundary" }).Click()
WMR.WaitElement({
name: "Set me up for seated and standing You won't have a boundary, so you'll need to stay put. To create a boundary later, go to Start > Mixed Reality Portal on your desktop."
}).Click()
WMR.WaitElement({ name: "I'm sure" }).Click()
WMR.WaitElement({ name: "Centre" }).Click() ; Sometimes it get's stuck when there's e.g not enough light. TODO: fix
WMR.WaitElement({ name: "Expand"}) ; Make sure window doesn't hide too soon.
if WMRBar {
Send("#y")
}
WinMinimize
}
Recenter()