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
647
Reaction score
358
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,091
Reaction score
14,628
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

Just spent $174 on Shining the Holy Ark on the Saturn. Good lord.
My brain when designing quests:
There is piano, it needs help --> The organ (yes organ now) is missing a component! --> Where the heck am I supposed to put this missing piece!??! --> Add an entire new mini dungeon specifically created to house this new piece. --> Connect this brand new mini dungeon to an already designed dungeon with background information about the town it's found it.

Me: :LZYhuh:
Rising of the Shield Hero!
Sheesh, Guys, don't think you can throw easy prices like $25/$50 on potions/ethers then have monsters pay you $75 for killing them (never understood that concept btw lol) and think it'll all work out!!! Just realized my prcies vs payout left my players unable to get decent stuff without some serious farming from the start, i'm about to call H&R Block to help my MC get his stimulus check just to buy new armor :LZSlol:

Forum statistics

Threads
111,095
Messages
1,058,223
Members
144,292
Latest member
yaribai871
Top