Disable mouse movement but not the clicking function?

Hello, I would like to know if there is any way to disable mouse movement without it stopping working like the Enter or Space button.
My idea would be, for example, to move with the keyboard to an object or event and when you are in front of it, it is activated when you press the left click.
Removing the relevant parts from moveByInput should do the trick. And you'd probably also want to remove the destination sprite. Here's a simple plugin that does that:
JavaScript:
Game_Player.prototype.moveByInput = function () {
    if (!this.isMoving() && this.canMove()) {
        var direction = this.getInputDirection();
        if (direction > 0) {
            $gameTemp.clearDestination();
            this.executeMove(direction);
        }
    }
};

Sprite_Destination.prototype.update = function () {}
Removing the relevant parts from moveByInput should do the trick. And you'd probably also want to remove the destination sprite. Here's a simple plugin that does that:
JavaScript:
Game_Player.prototype.moveByInput = function () {
    if (!this.isMoving() && this.canMove()) {
        var direction = this.getInputDirection();
        if (direction > 0) {
            $gameTemp.clearDestination();
            this.executeMove(direction);
        }
    }
};

Sprite_Destination.prototype.update = function () {}
It works very well but is there a way to make the click work as enter without having to put it on the event?
For example, the character is facing an event and the cursor is on the other side of the map but when you click on it, the event is activated.
It works very well but is there a way to make the click work as enter without having to put it on the event?
For example, the character is facing an event and the cursor is on the other side of the map but when you click on it, the event is activated.
Give this a try (I can't test it right now, so no guarantees here, but it should work):
JavaScript:
Game_Player.prototype.triggerAction = function () {
    if (this.canMove()) {
        if (this.triggerButtonAction()) {
            return true;
        }
    }
    return false;
};

Game_Player.prototype.triggerButtonAction = function () {
    if (Input.isTriggered('ok') || TouchInput.isTriggered()) {
        if (this.getOnOffVehicle()) {
            return true;
        }
        this.checkEventTriggerHere([0]);
        if ($gameMap.setupStartingEvent()) {
            return true;
        }
        this.checkEventTriggerThere([0, 1, 2]);
        if ($gameMap.setupStartingEvent()) {
            return true;
        }
    }
    return false;
};
Give this a try (I can't test it right now, so no guarantees here, but it should work):
JavaScript:
Game_Player.prototype.triggerAction = function () {
    if (this.canMove()) {
        if (this.triggerButtonAction()) {
            return true;
        }
    }
    return false;
};

Game_Player.prototype.triggerButtonAction = function () {
    if (Input.isTriggered('ok') || TouchInput.isTriggered()) {
        if (this.getOnOffVehicle()) {
            return true;
        }
        this.checkEventTriggerHere([0]);
        if ($gameMap.setupStartingEvent()) {
            return true;
        }
        this.checkEventTriggerThere([0, 1, 2]);
        if ($gameMap.setupStartingEvent()) {
            return true;
        }
    }
    return false;
};
Works perfect, thanks!!
Give this a try (I can't test it right now, so no guarantees here, but it should work):
JavaScript:
Game_Player.prototype.triggerAction = function () {
    if (this.canMove()) {
        if (this.triggerButtonAction()) {
            return true;
        }
    }
    return false;
};

Game_Player.prototype.triggerButtonAction = function () {
    if (Input.isTriggered('ok') || TouchInput.isTriggered()) {
        if (this.getOnOffVehicle()) {
            return true;
        }
        this.checkEventTriggerHere([0]);
        if ($gameMap.setupStartingEvent()) {
            return true;
        }
        this.checkEventTriggerThere([0, 1, 2]);
        if ($gameMap.setupStartingEvent()) {
            return true;
        }
    }
    return false;
};
Hey man, I tried to use this in rpg maker mz and it also works but it has the problem that it does not stop the interaction with the event after clicking.
To exemplify: on the first click it shows you the dialog, but on the second, instead of stopping it, it shows it again and again as long as you continue clicking, like a loop, and it only stops when you press space or enter, or when you hold down the click. Can it be solved?

I apologize if this is not the right forum to ask but I couldn't find anything similar anywhere else 🙁
Capture.PNG
When I plug in this, I see a small white box on the top left. Can you fix this?
Necro-post notice: @hello1231

Original thread: https://forums.rpgmakerweb.com/threads/disable-mouse-movement-but-not-the-clicking-function.162388/