Hiding mouse cursor after an idle time

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I am aware of the confirmed bugs relating to this in both -webkit- and chromium, so I would not be surprised if there really wasn't a way to fix this through rise vision, but I did encounter some interesting behavior differences between the preview of a display and the actual display.

Context: I have a multipage display that cycles through content on an idle timer, which checks for mouse movement and after not finding any for a period of time moves to the next content element. This is working like a charm but I want to be able to hide the cursor after a period of time as well.

I've tired using manipulating the css within my idle timer (changing document.body.style.cursor = "none" after a period of time, and then back to default on mouse move. But because chrome doesn't redraw until the mouse is active again the cursor doesn't 'hide' until it moves or clicks which resets my timer and makes it visible again.

Anyway, I tried spoofing clicks with javascript since I was only checking for movement for the timer, but because of the bug in chromium and in -webkit- this didn't help at all. But, curiously, when I preview this display my cursor does hide with my idle timer without the need for any movement or clicks.

I'm curious if there is some different between the player and the preview that might explain this difference, and, more importantly, but be a work around to this bug.
Photo of Joseph Mayberry

Joseph Mayberry

  • 1,206 Points 1k badge 2x thumb
  • curious, tentatively hopeful

Posted 4 years ago

  • 1
Photo of Neal

Neal

  • 61,252 Points 50k badge 2x thumb
The browsers used for the Windows and Linux Players are older versions. Windows is using version 24 of Chrome, and Linux is on version 25 of Chromium.

We've have had solutions to hiding the mouse pointer given in the forum previously.  For instance, this one. Have you had a chance to look them over?

Thanks.
Photo of Joseph Mayberry

Joseph Mayberry

  • 1,206 Points 1k badge 2x thumb
I have looked over a number of the previous discussions, but most are OS specific and I have not seen one that can be applied to the chromebox and Chrome OS. It isn't a problem per say, and I'm working on alternative solutions, I wanted to ask because the simple solution worked in the preview and if there was a way to make it also work in the display that would have been ideal. Thanks for the quick response though.
Photo of Neal

Neal

  • 61,252 Points 50k badge 2x thumb
Are you doing the Preview on a Chromebox?  Do you know if you're using the same version of Chrome everywhere (all stable, or all beta), or could there be differences that way?
Photo of Joseph Mayberry

Joseph Mayberry

  • 1,206 Points 1k badge 2x thumb
Was doing the preview on the chromebox, and then later on my pc just to check it again. At one point I had the display up and the preview in a window above it. Behavior was the same (worked fine for preview, did not work for player). Chrome browsers are all the same, not sure if the chrome app player runs a different version.
Photo of Neal

Neal

  • 61,252 Points 50k badge 2x thumb
Unless you've set the version of Chrome OS to a different channel, the Chrome App Player will use the stable version.

I have found a mention of using specifying a semi-transparent image with the mouse properties. It may show up as a small dot.  I realize this post is a bit old, but it may work for you.

Thanks.
Photo of Joseph Mayberry

Joseph Mayberry

  • 1,206 Points 1k badge 2x thumb
It isn't that cursor: none; doesn't work, it's that it doesn't redraw the cursor (regardless of what you are setting it to) until there is some mouse event. From what I have gathered from the chromium dev forums and the -webkit- forums this is a known bug in chrome and safari with no current solutions (at least that I am aware of) besides some really niche hack-ish methods.

But for some reason this works fine when I am previewing a display.

I threw together a stripped down display so you can see what I am talking about. there isn't any content, just code to hide the cursor every 10 seconds and show it whenever the mouse is moved.

http://preview.risevision.com/Viewer.html?type=presentation&id=8532c58c-6778-494a-87cf-7c61bcf5b...

when I preview it works fine, but when I run it on the chrome app player, it doesn't hide unless you physically click the mouse without moving it (I tired faking the click event in the javascript but that didn't work).
Photo of Joseph Mayberry

Joseph Mayberry

  • 1,206 Points 1k badge 2x thumb
Further testing suggests that this issue may not be directly related to the bug listed for chrome and -webkit-. Using some of the js (modified slightly) on a standard webpage I can hide the cursor after a period of inactivity in my chrome browser.

Given this, and the fact that the functionality works as expected in the preview but not in the player it does feel like there is some difference in the way that the player is delivering/displaying the signage that is causing a regression from what I'm seeing in the preview. Though I am not certain what, or even where this difference is occurring.

I am going to test this in the other versions of the player (right now I am only using the chrome app as our displays are being run on chromeboxes) but I am curious if there is a way to open the dev tools for chrome while in the player (I tried both F12 and the other hotkeys I could find online for doing this but none seemed to work). If I can access those tools I could see if the issue is with the redrawing of the cursor or the updating of the css attributes.