Jump to content

Right Click + Left Click Same Time


zeebo
 Share

Recommended Posts

Right click isn't a valid event in the browser, whatever you're using the shim it is listening for the context menu event, which won't fire if the left click is depressed, without a genuine right click event in the browser (which won't happen as its a reserved action, hijacking it is not encouraged) I doubt you can make it happen.

edit: actually, I've just checked and I can listen for the contextmenu event (fired on right click) even when my left button is depressed.

Only issue would be that I don't think there is any way to register 'un'-clicking the right button (mouseup), so it would still be impossible to accurately track when both buttons are depressed.

Link to comment
Share on other sites

There is no contextMenu up and contextMenu works like select inputs in that it 'steals' the mouse event when it fires so you'll get a mousedown but no mouseup.

I tried shimming a mouseup by playing with focus but it was dreadfully inconsistent, usually wrong, so I'm not sure how you'd grab a right click mouseup event.

edit: ha ha, worked it out, you just have to prevent default action for context menu and you'll get a mouseup! You'd have to assume it was from the right button though, you couldn't be 100% sure.

 

Link to comment
Share on other sites

On 2017-5-20 at 11:34 PM, zeebo said:

Thanks. Looks like it's a bug with PointerEvents because if I set window.PointerEvent = null it falls back to mouse events and works. I opened an issue on GitHub. Mouseup also tracks onContextMenu up. 

hi zeebo, i have the same problem, setting window.PointerEvent = null seems work for me, thanks. Is it your final solution? is there any side effect doing this?

Link to comment
Share on other sites

1 minute ago, Herbert said:

hi zeebo, i have the same problem, setting window.PointerEvent = null seems work for me, thanks. Is it your final solution? is there any side effect doing this?

Yeah it's the solution I'm going with for now. It's a little dirty, but it works. Firefox has PointerEvents disabled by default so Pixi falls back to mouse event callbacks if they are disabled / not supported by the current browser.

Link to comment
Share on other sites

5 minutes ago, zeebo said:

Yeah it's the solution I'm going with for now. It's a little dirty, but it works. Firefox has PointerEvents disabled by default so Pixi falls back to mouse event callbacks if they are disabled / not supported by the current browser.

ok thanks, if it is the bug from PointerEvent, I suppose this is a good choice. 

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...