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

Already on GitHub? Sign in to your account

Pointer lock #1

merged 1 commit into from Apr 26, 2013


None yet
2 participants

ricardobeat commented Jul 16, 2012

Hi Daniel,

I've implemented the pointer lock API. It should work in the latest Chrome and FF, but in FF mozRequestPointerLock is always undefined for some reason, so webkit only for now.


danielribeiro commented Jul 18, 2012


Thanks for the pull request. It looks awesome (saw your comment on HN). However I was unable to make it work on Google Chrome (Enable Pointer is set on chrome://flags/). If you have any ideas why, let me know and I'll gladly merge it.


  • Daniel

ricardobeat commented Jul 20, 2012

@danielribeiro did you restart Chrome after changing the flag? I'm on 21.0.1180.41 beta, OSX, maybe the API is not working yet on version 20 (current stable)?


danielribeiro commented Jul 20, 2012

I'm on Version 20.0.1132.47, mac os X, maybe that's why.


danielribeiro commented Aug 6, 2012

Wow! It does work. Chrome 21 is now standard, so testing it was amazing. There is one very glaring bug: the pointer position is not the cursor position, so the clicks are off... (putting and removing the wrong block).


ricardobeat commented Aug 8, 2012

Yeah, I used innerHeight|Width/2 as the anchor point but it's not working as intended.

@danielribeiro danielribeiro merged commit 7fd0b29 into danielribeiro:master Apr 26, 2013


danielribeiro commented Apr 26, 2013

I merged this, but since so many code changed since them, i'll be cherry picking it. Thanks for the pull request, and sorry for the delayed feedback.


ricardobeat commented Apr 26, 2013

Sorry for neglecting the fork, I see lots of conflicts. Feel free to rewrite it all, might be less time-consuming.

Now the pointer lock API is already available in Chrome and Firefox 🤘


danielribeiro commented Apr 26, 2013

No problem @ricardobeat! For reasons I cannot disclose + new job, this was set aside. I'll be cherry picking from it though. I also need to add full screen mode, and I plan on add a jump of goodness.

WebGL has been exciting recently and I'll write a new blog post about the cool things that changed ever since I first pushed this.

Again, thanks so much for the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment