Jump to content

How to event prevent default for right click pointerdown


eguneys
 Share

Recommended Posts

I have this code to detect both left click and right click:

    this.pan_container.hitArea = Rectangle(0, 0, this.gw, this.gh)
    this.pan_container.interactive = true
    this.pan_container.on('pointerdown', on_pan_begin)
    this.pan_container.on('pointermove', on_pan_move)
    this.pan_container.on('pointerupoutside', on_pan_end)
    this.pan_container.on('pointerup', on_pan_end)

 

Problem is right click opens up the context menu, which I do not want. 

I want right click event to preventDefault() so it doesn't open any context menu.

 

I've seen this issue, I've tried setting both to true and false but I couldn't disable the right click context menu pop up.

 this.App.renderer.plugins.interaction.autoPreventDefault = false;
 this.App.renderer.view.style.touchAction = 'auto';

https://github.com/pixijs/pixijs/issues/4824

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...