Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Mon 01/03/2004 18:18:47

Title: Right click
Post by: on Mon 01/03/2004 18:18:47
Is there a way to disable right click in a room? ???

Thanks  ;D
Title: Re:Right click
Post by: strazer on Mon 01/03/2004 18:38:50
Put a on_mouse_click function in the room's script and write

if (button==RIGHT) ClaimEvent();

Read the help file on ClaimEvent to see what it does.
Title: Re:Right click
Post by: on Mon 01/03/2004 20:20:24
I found another solution thx to you:

I disable all other cursor modes!

Thx!!
;D
Title: Re: Right click
Post by: punkrebel on Wed 30/06/2004 23:36:46
Can you explain me better how it works? maybe whit an example?

I want to disable in all room (so I think i'll put on global script).

tnx
Title: Re: Right click
Post by: Ishmael on Thu 01/07/2004 11:07:43
Find on_mouse_click on the global script, and romove anything put between the braces in the

if (button==RIGHT) {

}

thingy...
Title: Re: Right click
Post by: punkrebel on Thu 01/07/2004 21:44:37
I've done what you say, but if I click on the right-button the cursor still changin between two mode (now i don't remer that two mode is).

I want to do like the right-click doesn't exist..
Title: Re: Right click
Post by: Barbarian on Fri 02/07/2004 01:29:06
To disable right-clicking in specific rooms, add the following towards the top of that room's script file:

function on_mouse_click(int button)
{if (button==RIGHT) ClaimEvent();}


To disable for all rooms, I think from the global script, and under the
"function on_mouse_click(int button)" part, and where it reads:

else {Ã,  Ã, // right-click, so cycle cursor
SetNextCursorMode();Ã,  Ã, 
Ã,  }

You could simply remove the "SetNextCursorMode();" , so it would look like:

else {Ã,  Ã, // right-click, so cycle cursor
Ã,  }

Title: Re: Right click
Post by: punkrebel on Fri 02/07/2004 09:43:24
It's funny, i did what you told me and instead of don't change the cursor it show every cursor mode on the right click mouse
Title: Re: Right click
Post by: Scorpiorus on Sat 03/07/2004 11:07:36
Could you elaborate a bit? What Barbarian said should do the trick. You can also try putting the following line at the very top of on_mouse_click:

function on_mouse_click(int button) {
if ((button==RIGHT) || (button==RIGHTINV)) return;
// rest of the script
...
...
}