Movement by input blocker

Introduction
This plugin does what it says, blocks movement by input. No mouse movement, no arrow movement, no joypad movement... All it requires is a single switch.
Simply choose a switch through parameters and as long as it's off, the player can move. As long as it's on, the player can't move at all.

Download the plugin here
https://raw.githubusercontent.com/Poryg1/RPG-maker-MV-plugins/master/POR_InputBlock.js

License
This plugin is shared under MIT License. That means:
Free for commercial/non-commercial games
Free to edit
Free to share & repost, but not free to claim as your own work!

Credit would be nice, but is not required.
Great plugin!
When creating a small game(with clickable picture) by Parallel Process, I don't want player to move, and this is what I need!
Based on what I saw when I played with this, I expect I wouldn't be able to use $gameTemp.setDestination(x,y) to do pathfinding while the input is blocked? I expect Scene_Map would clear the destination. Can you confirm?
@Shaz $gameTemp.setDestination(x,y) is not the function that does pathfinding. Therefore it's completely redundant to call that one.

The function that does pathfinding is $gamePlayer.findDirectionTo (goalX, goalY).

You can of course use
Code:
$gameTemp.setDestination(x,y);
$gamePlayer.findDirectionTo ($gameTemp.destinationX(), $gameTemp.destinationY());
if you call these two inside one function, but it's completely useless. Instead it would be better to save these coordinates in a variable or something.
After all,
Code:
$gamePlayer.findDirectionTo ($gameVariables.value(1), $gameVariables.value(2));
might offer you much more flexibility and you can be sure that the $gameTemp will not clear that in next tick.
$gameTemp.setDestination(x,y) is what does pathfinding when you click with the mouse.

But yes, I already discovered findDirectionTo. My script is sorted now, with mouse/keyboard and menu access being blocked, but still being able to pathfind for the player.
It doesn't do pathfinding, it only sets the coordinates. Actual pathfinding is always done via $gamePlayer.findDirectionTo.
Just a small update:
I've uploaded a plugin that allows you to choose if you want to disable only the keyboard/gamepad movement, the mouse movement or both. It's called InputBlockerKM.
Hello can you help me
I am a beginner for js
I want to block the operation of two fingers on my phone. I still find a way to Will manage well
I found the link code, but I can't handle it properly. Can you recommend me?
Thanks for the reply

Code:
/**
* @static
* @method _onTouchStart
* @param {TouchEvent} event
* @private
*/
TouchInput._onTouchStart = function(event) {
    for (var i = 0; i < event.changedTouches.length; i++) {
        var touch = event.changedTouches[i];
        var x = Graphics.pageToCanvasX(touch.pageX);
        var y = Graphics.pageToCanvasY(touch.pageY);
        if (Graphics.isInsideCanvas(x, y)) {
            this._screenPressed = true;
            this._pressedTime = 0;
            if (event.touches.length >= 1) {
                this.___onCancel(x, y);
            } else {
                this._onTrigger(x, y);
            }
            event.preventDefault();
        }
    }
    if (window.cordova || window.navigator.standalone) {
        event.preventDefault();
    }
};
This would be what you're searching for inside of that function.
Code:
if (event.touches.length >= 1) {
                this.___onCancel(x, y);
            }
If you want to deactivate it via switch, it's easy.
Code:
if (event.touches.length >= 1 && !$gameSwitches.value(1)) {
                this.___onCancel(x, y);
            }

Original thread: https://forums.rpgmakerweb.com/threads/movement-by-input-blocker.90549/