Right Mouse Click Rebind

Orgaya

Veteran
Veteran
Joined
Oct 5, 2015
Messages
173
Reaction score
80
First Language
English
Primarily Uses
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.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
535
First Language
English
Primarily Uses
N/A
Out of curiosity, what is this for?
 

Orgaya

Veteran
Veteran
Joined
Oct 5, 2015
Messages
173
Reaction score
80
First Language
English
Primarily Uses
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.
 

Orgaya

Veteran
Veteran
Joined
Oct 5, 2015
Messages
173
Reaction score
80
First Language
English
Primarily Uses
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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,450
Members
137,820
Latest member
georg09byron
Top