Using right mouse -- without context menu?

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.


1 Like

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.

was the thread.

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

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 :smiley:


1 Like

thanks @Convict999 , works nice:

DOC, yes could be in the
page for the “RIGHT” button usage.

1 Like

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