How do I stop the Windows pop up on R-click?

Get help using Construct 2

Post » Thu Sep 28, 2017 7:24 pm

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?

Image


Here's an example capx I made to show the issue:
http://dansilber.com/wp-content/uploads ... eIssue.zip
B
19
S
3
Posts: 39
Reputation: 1,550

Post » Thu Sep 28, 2017 9:31 pm

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.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 722
Reputation: 4,026

Post » Thu Sep 28, 2017 9:44 pm

try:

Image

Code: Select all
"$(document).ready(function(){
 $(document).bind('contextmenu',function(e){
   return false;
 });
});"
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,104

Post » Thu Sep 28, 2017 9:51 pm

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.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 722
Reputation: 4,026

Post » Fri Sep 29, 2017 2:41 pm

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.
B
19
S
3
Posts: 39
Reputation: 1,550

Post » Fri Sep 29, 2017 2:43 pm

evilDan wrote: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.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 722
Reputation: 4,026

Post » Fri Sep 29, 2017 3:55 pm

I'll double check when I get back to the house. Thanks!
B
19
S
3
Posts: 39
Reputation: 1,550

Post » Sun Oct 01, 2017 8:01 pm

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?
B
19
S
3
Posts: 39
Reputation: 1,550

Post » Mon Oct 02, 2017 12:12 pm

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.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 722
Reputation: 4,026

Post » Mon Oct 02, 2017 4:50 pm

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.
B
81
S
33
G
27
Posts: 1,029
Reputation: 21,143


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest