Sign in to follow this  
Gijs

[SOLVED] [Firefox] Cannot rotate camera when pointer outside canvas

Recommended Posts

I suppose this is how each vendor wants to implement the security in his browser : can the active browser window still read the pointer events (and coordinates) when this one's outside it ?

Although I like Chrome as a Linux user, because it's the fastest browser for WebGL on this platform, I'm not sure that I prefer that it can still access the pointer events when it's outside the window ...

Share this post


Link to post
Share on other sites

Never mind, I found the solution after all:

canvas.addEventListener('mousedown', function(event){
    event.target.setCapture();
});

Thanks for your input @jerome

The events are only still received when you keep holding down the mouse button as you move outside the canvas

Edit: apparently it's not a cross-browser thing, so you can't use the snippet above like that

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.