# Using right mouse -- without context menu?

**URL:** <https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379>\
**Category:** Coding Questions\
**Created:** [March 17, 2019, 1:16pm UTC](https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379 "2019-03-17T13:16:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Convict999](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/convict999/32/4209_2.png) [@Convict999](https://discourse.processing.org/u/Convict999)\
**Post date:** [March 17, 2019, 1:16pm UTC](https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379/1 "2019-03-17T13:16:38Z")

</div>

Has anyone got an example of how to override the browser right click function in the preview window?  
It looks possible, but the thread i found isnt clear enough for my knowledge level.  
My code to check the rmb press seems to be working fine.

I feel this is something that should be added to the reference section.

Thanks

---

<div class="post-metadata">

**Author:** ![cansik](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/cansik/32/8815_2.png) [@cansik](https://discourse.processing.org/u/cansik)\
**Post date:** [March 18, 2019, 2:24pm UTC](https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379/2 "2019-03-18T14:24:22Z")

</div>

Please show us what you already tried out and it would really help if you link the thread you mentioned. Maybe also describe why this thread did not help you.

---

<div class="post-metadata">

**Author:** ![Convict999](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/convict999/32/4209_2.png) [@Convict999](https://discourse.processing.org/u/Convict999)\
**Post date:** [March 20, 2019, 1:29am UTC](https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379/3 "2019-03-20T01:29:02Z")

</div>

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/27830/prevent-right-click-from-opening-context-menu-yet-firing-object-s-mouseclick-event)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

  
was the thread.

a friend helped gave me the following to add to sketch.

```auto
document.oncontextmenu = function() {
    return false;
}

```

working good now, thanks for replying.  
I think it should be added to the reference as the potential defaults issue was hinted at but the given examples didnt work in my case, though fundamentally the same code. i am using web editor. I can post link to code later if you think ive found a glitch. #noobCoder 😃

thanks

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [March 20, 2019, 6:12am UTC](https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379/4 "2019-03-20T06:12:24Z")

</div>

thanks @Convict999 , works nice:  
[https://editor.p5js.org/kll/sketches/u6C9vjBLX](https://editor.p5js.org/kll/sketches/u6C9vjBLX)

DOC, yes could be in the  
[https://p5js.org/reference/#/p5/mouseButton](https://p5js.org/reference/#/p5/mouseButton)  
page for the “RIGHT” button usage.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 22, 2019, 10:56pm UTC](https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379/5 "2019-03-22T22:56:38Z")

</div>

> [@Convict999](#):
>
> I think it should be added to the reference

Interesting. Where would you add it to the reference? Perhaps open an issue suggesting this on the p5.js or website repo?

> **[Processing Foundation](https://github.com/processing)**
>
> We create platforms to promote software literacy within the visual arts, and visual literacy within technology-related fields. - Processing Foundation
