mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-24 01:42:05 +01:00
internal/ui: bug fix: recover the cursor mode when capturing fails
Closes #2764
This commit is contained in:
parent
429e0d8183
commit
6f3f567b58
@ -539,6 +539,10 @@ func (u *UserInterface) init() error {
|
|||||||
}))
|
}))
|
||||||
document.Call("addEventListener", "pointerlockerror", js.FuncOf(func(this js.Value, args []js.Value) any {
|
document.Call("addEventListener", "pointerlockerror", js.FuncOf(func(this js.Value, args []js.Value) any {
|
||||||
js.Global().Get("console").Call("error", "pointerlockerror event is fired. 'sandbox=\"allow-pointer-lock\"' might be required at an iframe. This function on browsers must be called as a result of a gestural interaction or orientation change.")
|
js.Global().Get("console").Call("error", "pointerlockerror event is fired. 'sandbox=\"allow-pointer-lock\"' might be required at an iframe. This function on browsers must be called as a result of a gestural interaction or orientation change.")
|
||||||
|
if u.cursorMode == CursorModeCaptured {
|
||||||
|
u.recoverCursorMode()
|
||||||
|
}
|
||||||
|
u.recoverCursorPosition()
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
document.Call("addEventListener", "fullscreenerror", js.FuncOf(func(this js.Value, args []js.Value) any {
|
document.Call("addEventListener", "fullscreenerror", js.FuncOf(func(this js.Value, args []js.Value) any {
|
||||||
|
Loading…
Reference in New Issue
Block a user