Hey folks,
I'm having a bit of an issue... I've got a game that uses mouse buttons frequently but whenever someone Right-clicks off screen, the windows menu pops up. I've added a screenshot and a capx to show the issue.
Anyone know how to disable the windows menu?
Here's an example capx I made to show the issue:
http://dansilber.com/wp-content/uploads ... eIssue.zip
I checked your capx and the menu only appears when you click outside the game window... I don't think you'll be able to avoid that from construct.
try:
"$(document).ready(function(){ $(document).bind('contextmenu',function(e){ return false; }); });"[/code:21qrr22v]
What you COULD do is set the fullscreen mode to Scale outer and center the objects when the layout starts. That way the black layer will be stretched and, since the whole browser window is now covered by your game, the mouse events won't trigger the windows menu.
Check this capx to see it at work.
https://www.dropbox.com/s/ckrxi1f1jqafo ... .capx?dl=0
Hope this helps. Cheers.
Thanks for the speedy responses!
brunopalermo - I believe that the game is already set to fullscreen mode - Scale outer (the capx I posted was just an example), but somehow users are still having issues...
korbaach - I will give this a try when I get back from work. Thanks for the suggestion! I'll let you know if it works.
Thanks for the speedy responses! brunopalermo - I believe that the game is already set to fullscreen mode - Scale outer (the capx I posted was just an example), but somehow users are still having issues...
I don't think so. If it were, the right-click wouldn't trigger a menu. Right-clicks on game window just don't do that.
I'll double check when I get back to the house. Thanks!
Hello again! Both solutions worked except for one related issue that remains:
Each time the right-mouse button is released, the mouse appears visible for a fraction of second.
Any additional tricks up your sleeves?
I tried to reproduce this issue, but I was unable to. I do manage to make the mouse visible or blink, sometimes, when I click both buttons fast enough. I couldn't find a way to avoid it, though.
Develop games in your browser. Powerful, performant & highly capable.
There's the Pointer Lock API that you could experiment with. It's a powerful API that allows for the full disabling of the mouse pointer. However, I believe it can only be activated with an actual user input event.