Right Mouse Click Rebind

Let me know if this is incorrectly placed or if something like this already exists. I attempted searching, but came up with no results that satisfies the criteria.

Essentially what I am looking for is a plugin that binds a keyboard key to the right mouse button, so that instead of opening the in game menu when you right click, it, say, activates the forward key.

Thanks in advance.
Out of curiosity, what is this for?
Out of curiosity, what is this for?

I am working with Alpha's ABS and wish to change the controls so you move with WASD (which I was able to change in the core script itself) and aim and use spells with the mouse. By default spells are allocated to the number keys. For spells that require aiming, pressing the number key activates an aiming ring around the cursor, left clicking activates the spell where that ring is.

What I would like to do is have it so the right mouse button is treated like the number 1 key so the left hand can focus on movement while the right hand focuses on attacking.
With the help of LTN Games (hyperlinked) the issue has been solved.

In case anyone wishes to know how to do this as well, here is how.

In the rpg_core script, find:

TouchInput._onRightButtonDown = function(event) {
var x = Graphics.pageToCanvasX(event.pageX);
var y = Graphics.pageToCanvasY(event.pageY);
if (Graphics.isInsideCanvas(x, y)) {
this._onCancel(x, y);
}
};

Everything below the first line calls the menu, so I moved that to the middle mouse button function which is right above this. In its place, I put this:

document.dispatchEvent(
new KeyboardEvent("keydown", {
key: "1",
keyCode: 49,
code: "Digit1",
which: 49
})
);

setTimeout(() => {
document.dispatchEvent(new KeyboardEvent("keyup", {
key: "1",
keyCode: 49,
code: "Digit1",
which: 49
}));
}, 250);
};

The right mouse button now inputs the number 1 key, and can be changed to whatever is desired.

This can be closed if a moderator wishes.

Original thread: https://forums.rpgmakerweb.com/threads/right-mouse-click-rebind.123005/