MZ [RMMZ] Disable/enable mouse input via script call?

Hello RPG Maker enthusiasts-!

Today, I'm curious as to if there's a way to disable/enable mouse input via a script call. I want there to be a part in my game where mouse input is NOT allowed in any form, but I wish to enable it again after that part.

If anybody knows how I could achieve this, do let me know! Thanks for reading. 😀

- HarlanX
Hi there!
I found it on the first result of my google search:
@Eliaquim found it on the first page of his Google search: links to Bing 🤣
I use something similar to the above, because without it, I will constantly misclick things on the map and send the party in all kinds of wrong directions.

However, unless I am misreading, the above will permanently disable mouse-based movement whereas OP is asking for a way to temporarily disable all forms of mouse input.

If that's the case, this small plugin would be a way to disable mouse input if game switch #1 is turned on.

JavaScript:
(() => {
    const touchInput_update = TouchInput.update;
    TouchInput.update = function() {
        if ($gameSwitches && $gameSwitches.value(1)) return;
        touchInput_update.apply(this);
    };
})();

If OP only wants to temporarily disable mouse-based movement but keep the rest of the mouse input enabled, we'd need to alias a different method.
This says it will enable/disable touch input

Original thread: https://forums.rpgmakerweb.com/threads/rmmz-disable-enable-mouse-input-via-script-call.162321/