MZ Is there a way to bind a fix set of keys/shortcuts to actor battle command window?

Hello! Thank you for reading. I was wondering is there a way to bind a fixed set of keys to the battle command window for actors?

For example, if you press 'W' it selects/triggers whatever is in the first option or Index(0)
and if you press 'A' it selects whatever is in Index(1) ect regardless of what is there

It's suppose to behave like a shortcut alternative to 'press arrow button, then Enter' motion and doesn't change any interaction with sub menus like skills or item if any. Example, if the first option was Attack, pressing 'W' registers like clicking on it. If the 4th option was Items, pressing 'D' will open up the item menu like usual.



example.png
Yeah, that's 100% possible, and shouldn't be too difficult. Unfortunately, I'm not at my regular PC right now, so I can't access the core scripts in order to tell you how to do it.
Ah no problem! Thank you for reading my post ^^
I know how to add WASD player movement to the corescript but when it comes to battle Im not sure what direction to go.
Ah no problem! Thank you for reading my post ^^
I know how to add WASD player movement to the corescript but when it comes to battle Im not sure what direction to go.
Are you going to be using WASD for player movement as well? If so, that will slightly change how you should go about this.
No, I won't be using WASD for player movement. It is still the arrow keys for movements.
WASD will be specifically used only in this particular scene/situation
I haven't tested it, but try this and see if it works:

JavaScript:
(() => {
    Input.keyMapper[65] = 'select1';  // a
    Input.keyMapper[68] = 'select3';  // d
    Input.keyMapper[69] = 'pagedown'; // e
    Input.keyMapper[83] = 'select2';  // s
    Input.keyMapper[87] = 'select0';  // w

    const _Window_ActorCommand_update = Window_ActorCommand.prototype.update;
    Window_ActorCommand.prototype.update = function() {
        this.processHotKeys();
        _Window_ActorCommand_update.call(this);
    };

    const _Window_PartyCommand_update = Window_PartyCommand.prototype.update;
    Window_PartyCommand.prototype.update = function() {
        this.processHotKeys();
        _Window_PartyCommand_update.call(this);
    };

    Window_Selectable.prototype.processHotKeys = function() {
        if (this.isCursorMovable()) {
            if (Input.isRepeated('select0')) {
                this.select(0);
                this.processOk();
            }
            if (Input.isRepeated('select1')) {
                this.select(1);
                this.processOk();
            }
            if (Input.isRepeated('select2')) {
                this.select(2);
                this.processOk();
            }
            if (Input.isRepeated('select3')) {
                this.select(3);
                this.processOk();
            }
        }
    };
})();
@Arthran Yes, that definitely works! ^^
And I see, so this is how it looks like on the inside.
I learnt a lot here, thank you very much for the help

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-bind-a-fix-set-of-keys-shortcuts-to-actor-battle-command-window.150576/