Is there a way to suppress the context menu on HTML5 builds?
I wanted to use the right mouse button for something but the context menu pops up whenever it’s pressed.
Is there a way to suppress the context menu on HTML5 builds?
I wanted to use the right mouse button for something but the context menu pops up whenever it’s pressed.
It seems like there is a javascript event that you can listen to. See https://stackoverflow.com/questions/4909167/how-to-add-a-custom-right-click-menu-to-a-webpage
Perhaps we should do something with that in the default wrapper page?
Thanks @sicher - I ‘solved’ this by adding the following to the body tag in index.html. Works on Chrome and Firefox - haven’t tested any further yet for unexpected consequences.
<body oncontextmenu="return false;">
You can put this in your main init as well
if html5 then
html5.run("canvas.oncontextmenu=function(e){e.preventDefault(); return false;}")
end
I recommend disabling the border on focus too
html5.run("canvas.style.outline = 'none'")
You can of course put this code in your html file as well.