Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pointer lock cannot be re-acquired after releasing #65

Closed
z3t0 opened this issue Dec 30, 2015 · 1 comment
Closed

Pointer lock cannot be re-acquired after releasing #65

z3t0 opened this issue Dec 30, 2015 · 1 comment

Comments

@z3t0
Copy link
Contributor

z3t0 commented Dec 30, 2015

Once the mouse loses focus (e.g if you press escape) you can get back "into" the game

@deathcap
Copy link
Member

Just saw this too, was about to file an issue. Wasn't a problem in the past, may have broken due to dependency updates or possibly browser pointer lock API behavior? Not easy to regress since voxel-engine-stackgl was broken until recently by browser WebGL changes (voxel/voxel-shader#11). Maybe related to this other pointer lock issue: voxel/voxel-inventory-hotbar#11 (comment)

Workaround: open browser console (View > Developer > JavaScript Console, on Google Chrome), enter:

game.shell.pointerLock = true

then the pointer-lock can be re-acquired by clicking the game area


There was this change new in game-shell 1.3.2: mikolalysenko/game-shell@066c47b Fix presumed typos with stickyPointerLock property - dependency of gl-now, used by voxel-engine-stackgl, but reverting to 1.3.1 does not restore the expected behavior.

Same results on Firefox 43.0.3 and Chrome 47.0.2526.106

@deathcap deathcap changed the title Permanent loss of focus Pointer lock cannot be re-acquired after releasing Dec 31, 2015
deathcap added a commit to voxel/voxel-engine-stackgl that referenced this issue Dec 31, 2015
If pointerLock is enabled, then also enable stickyPointerLock, in order
to continuously re-acquire pointer lock. This is needed to re-acquire after
pointer lock is released, but if undesirable behavior this default can be
overridden with the stickyPointerLock option to voxel-engine-stackgl.

Setting this option fixes a regression - previously (circa 2015/4) it was
not needed, but now it is required for correct behavior or you cannot "re-enter"
the game after exiting (relinquishing pointer lock with Esc). See:

voxel/voxelmetaverse#65 Pointer lock cannot be re-acquired after releasing
mikolalysenko/game-shell#8 `stickyPointerLock` typos fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants