DragonVoxSolar

Villager
Member
Joined
Jul 19, 2020
Messages
16
Reaction score
3
First Language
English
Primarily Uses
RMMV
I am looking for a way to change the normal arrow keys to the w a s d keys. Is there a way I can do that?
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
649
Reaction score
360
First Language
English
Primarily Uses
RMMV
If you wanted to just outright replace the function of the arrow keys with W A S D and wanted something more lightweight, this short plugin should do it for you:

JavaScript:
/*:
* @plugindesc Remaps the arrow keys to the WASD keys.
* @author Zevia
*
* @help This plugin simply remaps the arrow keys to the WASD keys. It is not
* configurable and was written to handle a specific user's request on the
* RPGMakerWeb forums.
*
* Note that W is, by default, the pagedown key, but will become unusable with this
* code.
*/

(function(module) {
    'use strict';

    module.Zevia = module.Zevia || {};

    module.Zevia.originalKeyMapper = Object.keys(Input.keyMapper).reduce(function(keyMap, key) {
        keyMap[key] = Input.keyMapper[key];
        return keyMap;
    }, {});
    ['37', '38', '39', '40'].forEach(function(keyCode) {
        delete Input.keyMapper[keyCode];
    });
    [
        { keyCode: 87, command: 'up' }, // W
        { keyCode: 65, command: 'left' }, // A
        { keyCode: 83, command: 'down' }, // S
        { keyCode: 68, command: 'right' } // D
    ].forEach(function(button) {
        Input.keyMapper[button.keyCode] = button.command;
    });
})(window);

It'll outright remove the ability to use the arrow keys at all and simply remaps them to the WASD keys, accordingly.

Keep in mind that, by default, "pagedown" is normally mapped to W, so this code will overwrite that.

If you want something more configurable, I'd suggest the above-linked plugin from @rexie09.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,211
Reaction score
14,683
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

Latest Threads

Latest Posts

Latest Profile Posts

Working on a case. Get all the evidence to prosecute some bad guys. :kaojoy:
But, the game development schedule delayed. :kaoswt2:
The moral of the story: No good deed goes unpunished... I guess...
Except that, nothing to see here. :kaoswt2:
just beat ff7 original for the first time since 2010. having played remake last year, I have a much better appreciation for the original oddly enough. I still like some of the character presentation in remake more, but the original's got a lot going for it.
Ever reach that moment in your life when your juggling a dozen or more projects that you know will never be made but don't have the heart to delete them? Ugh, I hate those moments...
:kaosigh: Why must you hurt me so?
my main character isn't the warrior of light or the chosen one, he's a self righteous, invasive try hard who gets ahead of himself and makes a critical error, resulting in a downward moral spiral that, eventually, leads him to truths that make him a better man, and im DAMN proud of that.

Forum statistics

Threads
111,451
Messages
1,061,200
Members
144,817
Latest member
tocurse
Top