How to detect holding right mouse button

Shiko

Villager
Member
Joined
Sep 26, 2015
Messages
27
Reaction score
9
First Language
English
Primarily Uses
RMMV
I already disabled the right mouse button so it won't go to the menu.
Now I'm doing something like this in a Common Event running on a parallel process:

Condition: TouchInput.isCancelled():
Do action

I wanted that as long as the button is being pressed it does the action. It works with the keyboard but it doesn't work with the right mouse button.
Does anyone know a way to make it work?

Edit: Already got it working. I changed a bunch of stuff in rpg_core.js which is not a great solution but it worked.
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,816
Reaction score
14,021
First Language
English
Primarily Uses
RMMV
How did you disable it so it won't go to the menu?
 

Shiko

Villager
Member
Joined
Sep 26, 2015
Messages
27
Reaction score
9
First Language
English
Primarily Uses
RMMV
How did you disable it so it won't go to the menu?
I changed a line rpg_scenes.js. I know I shouldn't but it worked.

Change this:
Code:
Scene_Map.prototype.isMenuCalled = function() {
    return Input.isTriggered('menu') || TouchInput.isCancelled();
};
to this:
Code:
Scene_Map.prototype.isMenuCalled = function() {
    return Input.isTriggered('menu');
};
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,816
Reaction score
14,021
First Language
English
Primarily Uses
RMMV
That code change shouldn't stop it working. Can you please post a pic of your common event? If it's on parallel process, there must be a switch to control it. Can you confirm that the switch is on? If you change the condition to something else (use one of the button conditions that already exists), does it work? The issue might be more with the design of the common event than with the condition.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,816
Reaction score
14,021
First Language
English
Primarily Uses
RMMV
A common event set to parallel process must have a switch. That's how you turn them on/off.

Please show a screenshot of your common event, with the whole common event window visible (don't crop it to just the commands).
 

Shiko

Villager
Member
Joined
Sep 26, 2015
Messages
27
Reaction score
9
First Language
English
Primarily Uses
RMMV
Well yeah, of course it has a switch so the common event works. Didn't understand what you meant before. I still don't understand why you want to see the common event since the problem was solved and the common event has nothing to do with it.

The common event is just there to check if the right button is pressed.
Here's an example. When the player clicks the mouse's right button it changes the graphics and because that line was changed it won't go to the menu.
 

Attachments

  • CommonEvent.JPG
    CommonEvent.JPG
    59.6 KB · Views: 23
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly! I will be beginning a play-through of Resident Evil 4! Feel free to drop by!

1st iteration on castle interior in Tiled.
I've started up Pillars of Eternity. It's interesting how the game does a "select choice" cutscene using still image art for dramatic flair. I wonder if that might work for my RPGMaker project.
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.
Gamedev for relaxing? yes or no?

Forum statistics

Threads
107,744
Messages
1,031,802
Members
139,882
Latest member
MoBard
Top