internal/uidriver/js: Add an error message when pointerlockerror happens

Updates #1604
This commit is contained in:
Hajime Hoshi 2021-04-20 12:22:31 +09:00
parent 18ce150495
commit 191cc667e1

View File

@ -396,6 +396,10 @@ func init() {
theUI.input.recoverCursorPosition() theUI.input.recoverCursorPosition()
return nil return nil
})) }))
document.Call("addEventListener", "pointerlockerror", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
js.Global().Get("console").Call("error", "pointerlockerror event is fired. 'sandbox=\"allow-pointer-lock\"' might be required.")
return nil
}))
} }
func setWindowEventHandlers(v js.Value) { func setWindowEventHandlers(v js.Value) {