Detect holding right mouse button?

Status
Not open for further replies.

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
160
Reaction score
12
First Language
Spanish
Primarily Uses
RMMV
Basically, I'm having the same problem as these two guys(1,2).
It seems like I'll have to make a couple of changes to rpg_core.js.
Probably here:
Code:
 * Checks whether the mouse button or touchscreen is currently pressed down.
 *
 * @static
 * @method isPressed
 * @return {Boolean} True if the mouse button or touchscreen is pressed
 */
TouchInput.isPressed = function() {
    return this._mousePressed || this._screenPressed;
};

/**
 * Checks whether the left mouse button or touchscreen is just pressed.
 *
 * @static
 * @method isTriggered
 * @return {Boolean} True if the mouse button or touchscreen is triggered
 */
TouchInput.isTriggered = function() {
    return this._triggered;
};

/**
 * Checks whether the left mouse button or touchscreen is just pressed
 * or a pseudo key repeat occurred.
 *
 * @static
 * @method isRepeated
 * @return {Boolean} True if the mouse button or touchscreen is repeated
 */
TouchInput.isRepeated = function() {
    return (this.isPressed() &&
            (this._triggered ||
             (this._pressedTime >= this.keyRepeatWait &&
              this._pressedTime % this.keyRepeatInterval === 0)));
};

/**
 * Checks whether the left mouse button or touchscreen is kept depressed.
 *
 * @static
 * @method isLongPressed
 * @return {Boolean} True if the left mouse button or touchscreen is long-pressed
 */
TouchInput.isLongPressed = function() {
    return this.isPressed() && this._pressedTime >= this.keyRepeatWait;
};

/**
 * Checks whether the right mouse button is just pressed.
 *
 * @static
 * @method isCancelled
 * @return {Boolean} True if the right mouse button is just pressed
 */
TouchInput.isCancelled = function() {
    return this._cancelled;
};


/**
 * Checks whether the mouse or a finger on the touchscreen is moved.
 *
 * @static
 * @method isMoved
 * @return {Boolean} True if the mouse or a finger on the touchscreen is moved
 */
TouchInput.isMoved = function() {
    return this._moved;
};

/**
 * Checks whether the left mouse button or touchscreen is released.
 *
 * @static
 * @method isReleased
 * @return {Boolean} True if the mouse button or touchscreen is released
 */
TouchInput.isReleased = function() {
    return this._released;
};

I've tried my best but I can't figure it out, could someone write a code similar to
TouchInput.isPressed = function() {
return this._mousePressed || this._screenPressed;
};

but for the "Cancelled" button?
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
160
Reaction score
12
First Language
Spanish
Primarily Uses
RMMV
Rikyu found an answer!
1603295626622.png
activate plugin then in only this 2 lines you copy paste for the first one ''$gameSwitches.setValue(($gameVariables.value(21)||5), true);'' and for the second one ''$gameSwitches.setValue(5, false);
1603295699995.png
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,829
Reaction score
5,221
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

grief... lol... I keep seeing request for MZ versions of MV plugins. this is why I haven't moved over and just MZ for my MV project.
Egg-sitting minigame is coming along nicely. Are you a bad enough dino to keep all these raptor eggs warm?

I forgot to post the animated version of the previous map I was working on. I'm still arguing with myself on if I like the stark blue ground better than the undergrowth ground used on the waterfall map. Hmm...
now that fmod is free for indie(<200k revenue), it would be interesting to see someone add fmod support for rpg maker
Can't say I can't promise progress on a project just yet. But I can say I had fun databasing tonight. :)

Forum statistics

Threads
105,800
Messages
1,016,560
Members
137,494
Latest member
soikeohomnay
Top