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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.