MV A simple WASD plugin. Looking for an alternative to Yanfly's "Keyboard Configl".

I want people to be able to use the modern standard WASD movement controls, but also use the arrows keys, if that's more familiar to them. Yanfly's "Keyboard Config" allows you to do that. However, I DO NOT want people to have to go into the options menu and manually select WASD movement.

I want WASD and the arrow keys to be the default. I don't want there to even be an option in the menu. Is there a plugin that just does that and nothing else?
Check out the short tutorial I made on setting WASD as the default in Yep Keyboard Config

Tutorial

short editorializing:
Good on ya for thinking about the folks who have a preference in control style. I wish more RPG devs would consider that.
Never mind...:LZSteary:
Check out the short tutorial I made on setting WASD as the default in Yep Keyboard Config

I see your tutorial, and it's very helpful, but I want to completely remove Yanfly's Keyboard Config from the options menu completely. I just want WASD movement by default. But I also want dinosaurs to still be able to use the arrow keys (in other words you can use either). I don't want there to be a choice in the options menu.
but why?
Player choice - especially in controls - is always a good thing. Why would you remove that?
Not to mention Keyboard Config allows players who are using different keyboard layouts to be able to play your game, such as those using Dvorak or Colemark, or even the weirdos who prefer ESDF over WASD.
Man...am I going to have to retract my editorializing?

I did it with my first game (mostly because I didn't know Keyboard Config was a thing at the time) by editing one of the core scripts directly. If someone doesn't beat me to the punch with a solution to your no-player-accessibility preference in keyboard control then I'll post what you need to edit here.

edit:
Here, I think this is the reddit post I followed before that gave me the information on editing keys directly.
u/Scripturus posts the answer, while u/fear5d makes a point about not editing the core script directly. Read both.
Link
Editing the keymapper is actually much easier than that Reddit post describes. If you're duplicating a function, there's zero reason to define it as a new key and then look through other places or make events to tie it in.

left is already defined in there and it's what the engine uses for movement and such, so you'd simply add:
Code:
65: 'left', // A

and now pressing A will do everything that left does.

But I agree with @TheAM-Dol, given the option to really simply have this as a preset but allow people to configure it on their own, I don't understand how that isn't the clearly superior choice.
but why?
Player choice - especially in controls - is always a good thing. Why would you remove that?
Not to mention Keyboard Config allows players who are using different keyboard layouts to be able to play your game, such as those using Dvorak or Colemark, or even the weirdos who prefer ESDF over WASD.
Man...am I going to have to retract my editorializing?

But I agree with @TheAM-Dol, given the option to really simply have this as a preset but allow people to configure it on their own, I don't understand how that isn't the clearly superior choice.

Haha, I TOTALLY get where you guys are coming from, I really do. But more user options doesn't automatically mean more fun. Sometimes limitations make a game more fun, and that's the type of game I'm making.
You and I are clearly developing the complete opposite kind of game...
GameRules.png


Yeah, I don't think anyone ever said options are about fun, it's about being comfortable while playing. Maybe it's something you can only appreciate after you bought a game and realized they don't support your favored control scheme? :LZSskeptic: On controller, I'm a weirdo. For whatever reason, my brain can't wrap itself around the idea of normal X axis controls. I can only play inverted X. Most games support inverted X, but not all of them, so it's always a sad day when I have to refund a game because the devs didn't add an option to their menu.
Totalbiscuit is rolling in his grave :LZSteary:

But, whatever. Right on, man. You do you.
This seems to work for me:
Spoiler: Plugin code
JavaScript:
/*:
 * @plugindesc Move with WASD and arrows. Original W (pagedown) moved to E.
 * @help Free to use and/or modify for any project, no credit required.
 */
Object.assign(Input.keyMapper, {
  69: 'pagedown',  // E
  87: 'up',        // W
  65: 'left',      // A
  83: 'down',      // S
  68: 'right'      // D
});
Note that this merely alters RMMV's core script structure, which determines key presses using the deprecated, implementation-dependent keyCode property:
You and I are clearly developing the complete opposite kind of game...
GameRules.png


Yeah, I don't think anyone ever said options are about fun, it's about being comfortable while playing. Maybe it's something you can only appreciate after you bought a game and realized they don't support your favored control scheme? :LZSskeptic: On controller, I'm a weirdo. For whatever reason, my brain can't wrap itself around the idea of normal X axis controls. I can only play inverted X. Most games support inverted X, but not all of them, so it's always a sad day when I have to refund a game because the devs didn't add an option to their menu.
Totalbiscuit is rolling in his grave :LZSteary:

But, whatever. Right on, man. You do you.

"Right on, man. You do you."

Thanks, dude, I appreciate your support!


This seems to work for me:
Spoiler: Plugin code
JavaScript:
/*:
* @plugindesc Move with WASD and arrows. Original W (pagedown) moved to E.
* @help Free to use and/or modify for any project, no credit required.
*/
Object.assign(Input.keyMapper, {
69: 'pagedown', // E
87: 'up', // W
65: 'left', // A
83: 'down', // S
68: 'right' // D
});
Note that this merely alters RMMV's core script structure, which determines key presses using the deprecated, implementation-dependent keyCode property:

Thanks, caethyril. Looks promising, I'll try it out tomorrow, as I just drank a glass of milk and must now go to bed.
Maybe I'm way wrong here, but I thought WASD was active in MV by default?
Maybe I'm way wrong here, but I thought WASD was active in MV by default?

You would think, right?, but no. Not only is WASD not supported by default, they made it extra-difficult to get around by hard-wiring the W key to "page down" for some reason.

I mean REALLY, why would ANYONE think to use the W key as a stand-in for Page Down?

But I agree with @TheAM-Dol, given the option to really simply have this as a preset but allow people to configure it on their own, I don't understand how that isn't the clearly superior choice.

Now that I think about it, that would be a great argument to make to the makers of RPG Maker. Why do we need a convoluted plugin to map our own keys? Yes, the Yanfly plugin could be useful, but it is visually confusing and has a clumsy and ugly interface. Here's what it looks like on my game:


stupislookinginterface.png


Every other game that I've ever played that has a keymapping option makes it really simple by giving you a scroll-down list of keys, which you can easily reassign however you want, and will usually even warn you if you are reassigning an important key.

But the main problem, in my view, is that even if you have the Yanfly plugin installed, the player must still go to Menu > Options > Keyboard Config > and then look around a cluttered menu for WASD movement. I want my game to automatically use WASD + arrow keys by default, so the user never has to deal with the menu options in the first place.
as pageDown/PageUp = QW or WE to cycle through which I use
instead of page down/up 🙂
as pageDown/PageUp = QW or WE to cycle through which I use
instead of page down/up

I hear you, but this is not at all a standard thing in games. Can you name one other game engine that uses that by default?

WASD is by far the standard. I have over 200 games on Steam alone, and pretty much all of them use WASD for movement by default. Even the really old games from over 20 years ago. For the vast majority of gamers, that's just where your fingers go when you start up a new game. It's basic muscle-memory.

And there's a very good reason for that. To have to move your left hand all the way over to the right side of the keyboard to use the arrow keys gets uncomfortable after a while. Look, I'm not trying to make a federal case out of this, but could RPG Maker please just join the 21st century already?
WASD is not always standard, for online games maybe that require
the mouse as direction.

on this site, all the games I played/beta tested/for fun, I use QW to cycle through
faster instead the pageDown/Up.

single player games like 2D, I mostly use the arrow keys to walk, space/ctrl to jump
if it exist.

but you can asign keys to default on those keyboard button, and player can change
that if they like.

I prefer arrows over WASD or ESDF part (2nd is something I never used yet).

what if you have a world map => open map on W? or shortcut to "W"eapons?
"A"rmors or for quick crafting using those?

I prefer arrows, both can be fine if done nicely, but also let the player set up
the way they used too.

it is ofcourse your course of action, and I respect that, your game, your choice.
but dont try to restrict it for not changing 🙂

Small edit:
there are games that uses WASD as "strafe" instead of moving 🙂
/*: * @plugindesc Move with WASD and arrows. Original W (pagedown) moved to E. * @help Free to use and/or modify for any project, no credit required. */ Object.assign(Input.keyMapper, { 69: 'pagedown', // E 87: 'up', // W 65: 'left', // A 83: 'down', // S 68: 'right' // D });

This seems to work for me:
SPOILER: PLUGIN CODE
JavaScript:
/*:
* @plugindesc Move with WASD and arrows. Original W (pagedown) moved to E.
* @Help Free to use and/or modify for any project, no credit required.
*/
Object.assign(Input.keyMapper, {
69: 'pagedown', // E
87: 'up', // W
65: 'left', // A
83: 'down', // S
68: 'right' // D

});


This works perfectly unless you using Yanfly's "Button Common Events" plugin (which I am). It took me a while but I narrowed it down to that conflict, and it doesn't matter what order they're in, the W key doesn't make the player move up.
This seems to work for me:
SPOILER: PLUGIN CODE
JavaScript:
/*:
* @plugindesc Move with WASD and arrows. Original W (pagedown) moved to E.
* @Help Free to use and/or modify for any project, no credit required.
*/
Object.assign(Input.keyMapper, {
69: 'pagedown', // E
87: 'up', // W
65: 'left', // A
83: 'down', // S
68: 'right' // D

});


This works perfectly unless you using Yanfly's "Button Common Events" plugin (which I am). It took me a while but I narrowed it down to that conflict, and it doesn't matter what order they're in, the W key doesn't make the player move up.
For the record, I did turn off all other plugins, and this is MV.
but it is visually confusing and has a clumsy and ugly interface.
Not arguing that, it's definitely clunky and ugly and gets uglier if your use common event keys; god forbid you have a an event with a name longer than 5 characters and the whole thing gets squished to hell. Trust me, after using many of Yanfly's plugins, I've noticed just...strange decisions made about their design. I guess it's just Yanfly's personality...or something...

The reason I am so adamant about people using Keyboard Config isn't because it's beautiful. It's because it's easy to set up, free to use, compatible with pretty much everything, and gives your players the power to set the controls the way they are most comfortable with.

Would be nice if a skilled programmer gave it a nice glow-up though :LZSangel:
If you just want an alternative button mapper, have you tried this one?

This works perfectly unless you using Yanfly's "Button Common Events" plugin (which I am). It took me a while but I narrowed it down to that conflict, and it doesn't matter what order they're in, the W key doesn't make the player move up.
Yes, because YEP Button Common Events changes button mappings. From its help:

This plugin will most likely have compatibility issues with anything that alters keystrokes or makes use of them through a different manner.
Here's a patch (untested), you can add it to the end of the plugin code I posted earlier:
JavaScript:
// Patch - YEP Button Common Events compatibility
void (function(alias) {
  Input._revertButton = function(button) {
    alias.apply(this, arguments);
    // W should revert to up
    if (['PAGEDOWN', 'ALL'].contains(button))
      this.keyMapper[87] = 'up';
  };
})(Input._revertButton);
The SwitchButton plugin command might still mess things up, I don't know if you're using that. Alternatively you could try out one of the various other "common event on key press" plugins, e.g.
Hime's stuff is usually good for cross-compatibility, haven't tried that plugin myself though.
@caethyril
The patch seems to work perfectly. Once again, thank you so much!
You're welcome! Feel free to report your thread to be closed if/when you're confident there are no remaining problems~ 👋

Original thread: https://forums.rpgmakerweb.com/threads/a-simple-wasd-plugin-looking-for-an-alternative-to-yanflys-keyboard-configl.151961/