Hide mouse cursor when idle

Hello everyone. Today I'd like to release a plugin I just made. I call it: N_HideIdleMouse

This plugin is available on GitHub: https://github.com/Nolonar/RM_Plugins-HideIdleMouse
Direct download link for the latest version available: https://github.com/Nolonar/RM_Plugins-HideIdleMouse/releases/latest/download/N_HideIdleMouse.js

It simply hides the mouse cursor when idle.
It also hides the mouse cursor immediately when the game starts, because otherwise the player would need to move the mouse at least once before the auto-hiding kicks in.

Note: The mouse cursor is only hidden when it is inside the game window. This is not a bug.

How to use
Just enable the plugin, that's it.
You can customize how long the mouse can remain idle before it is hidden. By default, the timeout is 3000 milliseconds (3 seconds).


If you don't care about the mouse at all and simply wish to keep it hidden at all times, you can just use the following one-liner.
JavaScript:
document.body.style.cursor = 'none';
Simply paste it into a text file, change the file extension from .txt to .js, and you have your plugin.


Terms of use
The one-liner (above) has absolutely no Terms of Use. Do with it whatever you want.

For the full plugin, the MIT license applies. In short, as long as you preserve the copyright and license notice, you're free to do whatever you want with it
Hello how are you, I was testing this plugin and it works very well but I try to use it with another plugin called "TDDP Mouse System Ex" and it doesn't work.

If I use a custom cursor (an image or icon for example) the cursor is not hidden after 3000 milliseconds.

Is there a possibility to make it compatible with this plugin? Thank you.
Hello how are you, I was testing this plugin and it works very well but I try to use it with another plugin called "TDDP Mouse System Ex" and it doesn't work.

If I use a custom cursor (an image or icon for example) the cursor is not hidden after 3000 milliseconds.

Is there a possibility to make it compatible with this plugin? Thank you.

I just wanted you to know that I've seen your post and that I will deal with it as soon as I can. Unfortunately I can't tell when that will be, but I should probably have a fix within the week.

I'm sorry for the inconvenience.
@isaias20
Apologies for the delay. I've just released version 1.0.2, which should be compatible with TDDP – MouseSystemEx.

Please let me know if there's still any problem.
@isaias20
Apologies for the delay. I've just released version 1.0.2, which should be compatible with TDDP – MouseSystemEx.

Please let me know if there's still any problem.

Hello, how are things?

I just tried it even in a new project, I only have those two scripts and it doesn't work for me, the cursor stays on the screen even after more than 3 seconds elapsed. My custom cursor is in the " \img\cursors " folder.

error plugin cursor 2.png


complemento de error cursor.png


any solution? thank you.

It seems your plugin only works when I use the default cursor, not a custom one.
@isaias20
I can't get the custom cursor working at all, even with my plugin disabled. So I can't test this configuration in depth. I've created a "default.png", I've set the "Use Custom Cursor?" field to "true", but I only get the default cursor.

But it's possible you encountered a different bug that isn't related to TDDP - MouseSystemEx.

This plugin has a known bug, where the cursor only disappears if the mouse is in the lower right quarter of the window. From what I found out, this seems to be a bug in Chromium itself, so it's not something I can fix (and believe me, I tried).

One workaround is to play in full screen mode. Another is to play the game on a browser, possibly one that is not Chrome.

Can you confirm if the mouse cursor is still visible, even if it's in the lower right corner? If so, can you send me a demo project where the bug appears?
@isaias20
I can't get the custom cursor working at all, even with my plugin disabled. So I can't test this configuration in depth. I've created a "default.png", I've set the "Use Custom Cursor?" field to "true", but I only get the default cursor.

But it's possible you encountered a different bug that isn't related to TDDP - MouseSystemEx.

This plugin has a known bug, where the cursor only disappears if the mouse is in the lower right quarter of the window. From what I found out, this seems to be a bug in Chromium itself, so it's not something I can fix (and believe me, I tried).

One workaround is to play in full screen mode. Another is to play the game on a browser, possibly one that is not Chrome.

Can you confirm if the mouse cursor is still visible, even if it's in the lower right corner? If so, can you send me a demo project where the bug appears?

the mouse is always visible, (custom cursor), no matter where it is on the screen.

Here is the project: https://www.mediafire.com/file/kkuariuq68d05iv/Project5.rar/file
@isaias20
Thanks for the demo project, it helped me test my fix properly.

Version 1.0.3 is now online and should fix the incompatibility.

Unfortunately, the corner bug still exists, so the cursor only disappears if the mouse is in the lower right corner, or if you click (after the timeout), or if you move the mouse by only 1 pixel (after the timeout). The bug affects both MV and MZ. I think it's a refresh bug in Chromium. The browser engine probably only updates the cursor when you use the mouse, but not after its cursor setting has changed.

I'll keep looking for a proper workaround, but playing in fullscreen helps a lot against this bug. Here's one plugin that launches the game in fullscreen:

You can also use somebody else's plugin if you don't like mine.
@isaias20
Thanks for the demo project, it helped me test my fix properly.

Version 1.0.3 is now online and should fix the incompatibility.

Unfortunately, the corner bug still exists, so the cursor only disappears if the mouse is in the lower right corner, or if you click (after the timeout), or if you move the mouse by only 1 pixel (after the timeout). The bug affects both MV and MZ. I think it's a refresh bug in Chromium. The browser engine probably only updates the cursor when you use the mouse, but not after its cursor setting has changed.

I'll keep looking for a proper workaround, but playing in fullscreen helps a lot against this bug. Here's one plugin that launches the game in fullscreen:

You can also use somebody else's plugin if you don't like mine.

Hello, I just tried the new version and it works perfect!

I don't have to place the mouse in any corner. Anywhere on the screen is hidden.

Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/hide-mouse-cursor-when-idle.92805/