When a user right clicks an object in my game I would like to be able to have a menu come up. Is it possible to override the right click event only for the canvas and still allow normal right click functions outside of the canvas?
Thanks,
Achilles
When a user right clicks an object in my game I would like to be able to have a menu come up. Is it possible to override the right click event only for the canvas and still allow normal right click functions outside of the canvas?
Thanks,
Achilles
document.onmousedown = handleMouseDown;
function handleMouseDown(event){
if ( mouse_pos ) inside gl canvas
return false;
else
return true;
}
true = menu comes up
false = no menu
Thanks zed. Very helpful!
-Achilles