Right-click to move?

Is there a way to make it so right-clicking in the game window does not bring up the menu, but instead acts just like left click (so it moves the character)?

I've moved this thread to MV Support. Thank you.

So you want both buttons to do the same function as the left button? Sure, just toss this into a plugin.

JavaScript:
/**
 * @static
 * @method _onMouseDown
 * @param {MouseEvent} event
 * @private
 */
TouchInput._onMouseDown = function(event) {
    if (event.button === 0 || event.button === 2) {
        this._onLeftButtonDown(event);
    } else if (event.button === 1) {
        this._onMiddleButtonDown(event);
    }
};

/**
 * @static
 * @method _onMouseUp
 * @param {MouseEvent} event
 * @private
 */
TouchInput._onMouseUp = function(event) {
    if (event.button === 0 || event.button === 2) {
        var x = Graphics.pageToCanvasX(event.pageX);
        var y = Graphics.pageToCanvasY(event.pageY);
        this._mousePressed = false;
        this._onRelease(x, y);
    }
};
Since this actually requires a small plugin (since you have the modify the default code), I'm moving this thread in the appropriate sub-forum.

Moved to JS Plugin Request

So you want both buttons to do the same function as the left button? Sure, just toss this into a plugin.

JavaScript:
/**
* @static
* @method _onMouseDown
* @param {MouseEvent} event
* @private
*/
TouchInput._onMouseDown = function(event) {
    if (event.button === 0 || event.button === 2) {
        this._onLeftButtonDown(event);
    } else if (event.button === 1) {
        this._onMiddleButtonDown(event);
    }
};

/**
* @static
* @method _onMouseUp
* @param {MouseEvent} event
* @private
*/
TouchInput._onMouseUp = function(event) {
    if (event.button === 0 || event.button === 2) {
        var x = Graphics.pageToCanvasX(event.pageX);
        var y = Graphics.pageToCanvasY(event.pageY);
        this._mousePressed = false;
        this._onRelease(x, y);
    }
};
Thank you kindly, friend! It didn't work. lol

I dropped it into it's own .js file and loaded that as a plugin, and I then also did this, thinking maybe I needed the structure all the plugins I've seen use:

JavaScript:
/*:
 * @plugindesc Right mouse button moves the character. by ImaginaryVillain
 *
 * @help This plugin does not provide plugin commands.
 */

(function () {

/**
 * @static
 * @method _onMouseDown
 * @param {MouseEvent} event
 * @private
 */
TouchInput._onMouseDown = function(event) {
    if (event.button === 0 || event.button === 2) {
        this._onLeftButtonDown(event);
    } else if (event.button === 1) {
        this._onMiddleButtonDown(event);
    }
};

/**
 * @static
 * @method _onMouseUp
 * @param {MouseEvent} event
 * @private
 */
TouchInput._onMouseUp = function(event) {
    if (event.button === 0 || event.button === 2) {
        var x = Graphics.pageToCanvasX(event.pageX);
        var y = Graphics.pageToCanvasY(event.pageY);
        this._mousePressed = false;
        this._onRelease(x, y);
    }
    
})();

That didn't do me any good either. The game's menu still pops up.
That's because you put it in a function, but nothing is calling your function.

edit: I was going to attach a working version of the plugin but for some reason the forum just shows it with a line through the name and it won't upload. So just copy exactly this into a file and save it as anythingYouWant.js

JavaScript:
/*:
@Author Imaginary Villain
@title Move with right mouse button.
@plugindesc Right mouse button also moves player.
@help
------------------------------------------------------------------------
Plug and play, makes the right mouse button duplicate the functionality of the
left mouse button.

------------------------------------------------------------------------
*/

/**
 * @static
 * @method _onMouseDown
 * @param {MouseEvent} event
 * @private
 */
TouchInput._onMouseDown = function(event) {
    if (event.button === 0 || event.button === 2) {
        this._onLeftButtonDown(event);
    } else if (event.button === 1) {
        this._onMiddleButtonDown(event);
    }
};

/**
 * @static
 * @method _onMouseUp
 * @param {MouseEvent} event
 * @private
 */
TouchInput._onMouseUp = function(event) {
    if (event.button === 0 || event.button === 2) {
        var x = Graphics.pageToCanvasX(event.pageX);
        var y = Graphics.pageToCanvasY(event.pageY);
        this._mousePressed = false;
        this._onRelease(x, y);
    }
};
Thank you! It works beautifully. Funny thing is, the first time around, before I did the whole function bit, I actually did just copy and paste this into a plugin, exactly like this, minus the comment block at the top. I'm a little confused as to what's different here and why it works now.

The important thing, though, is that it does work now. haha Thanks again!
Quite welcome! As for the error you had, without seeing what you did it's hard to say. The comment code above isn't even required, people just seem to like it as it makes them feel more like it's a legitimate plugin. All that does is stuff like add a description and the help information in the editor. The code works perfectly fine without it.

Original thread: https://forums.rpgmakerweb.com/threads/right-click-to-move.119411/