Skip to content
This repository was archived by the owner on Jan 24, 2020. It is now read-only.

Commit c0b4492

Browse files
author
Avaer Kazmer
committed
Trigger bring UI to top on pointer lock change
1 parent 59b8a5e commit c0b4492

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

index.html

+9
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,15 @@
11251125
window.addEventListener('minimize', e => {
11261126
uiIframe.hide();
11271127
});
1128+
window.document.addEventListener('pointerlockchange', e => {
1129+
if (window.document.pointerLockElement) {
1130+
for (let i = 0; i < 1000; i += 100) {
1131+
setTimeout(() => {
1132+
_bringUiToTop();
1133+
}, i);
1134+
}
1135+
}
1136+
});
11281137

11291138
// events
11301139

0 commit comments

Comments
 (0)