Cursor hiding (after inactivity & focus loss) #361

Closed
opened 2026-02-20 10:16:49 -05:00 by deekerman · 1 comment
Owner

Originally created by @minotalen on GitHub (Oct 7, 2021).

Originally assigned to: @robartsd on GitHub.

Sometimes players join a room and don't participate. Sometimes they open a new tab or switch applications.
In both cases it can happen that the player cursor stays on board for a long time. Guess the best way to check for inactivity is to watch whether the cursor coordinates stay the same for some duration. Maybe the player cursor could start fading after ~20 secs of immobility, reaching 100% transparency after a minute. The cursor would immediately become visible again after movement.

Don't know if there is a way to check for focus loss (player switching tabs or application) but if there is, it might make sense to fade the cursor immediately for that case.

Originally created by @minotalen on GitHub (Oct 7, 2021). Originally assigned to: @robartsd on GitHub. Sometimes players join a room and don't participate. Sometimes they open a new tab or switch applications. In both cases it can happen that the player cursor stays on board for a long time. Guess the best way to check for inactivity is to watch whether the cursor coordinates stay the same for some duration. Maybe the player cursor could start fading after ~20 secs of immobility, reaching 100% transparency after a minute. The cursor would immediately become visible again after movement. Don't know if there is a way to check for focus loss (player switching tabs or application) but if there is, it might make sense to fade the cursor immediately for that case.
Author
Owner

@robartsd commented on GitHub (Oct 7, 2021):

I'm in favor of cursors fading as well (I'd prefer much faster than a minute - probably similar to PCIO's timing). Others have argued for the cursor because the side channel information is similar to a person's hand position while playing in person. I think a stale cursor position causes a large difference in what it communicates based on the user's input device (mouse vs. touch) so it should fade out for everyone.

I think we should temporarily put a class in the cursor while it is moving setting a callback to remove the class shortly after it stops moving. We could also have a class to indicate that the mouse/touch is down - perhaps making the cursor more opaque while clicking/dragging. CSS can handle the actual fadeout based on the removal of the class. Then if we implement game css, game designers would be able to adjust this behavior with no additional game engine code.

This as been previously brought up in #249, #111, & #94.

@robartsd commented on GitHub (Oct 7, 2021): I'm in favor of cursors fading as well (I'd prefer much faster than a minute - probably similar to PCIO's timing). Others have argued for the cursor because the side channel information is similar to a person's hand position while playing in person. I think a stale cursor position causes a large difference in what it communicates based on the user's input device (mouse vs. touch) so it should fade out for everyone. I think we should temporarily put a class in the cursor while it is moving setting a callback to remove the class shortly after it stops moving. We could also have a class to indicate that the mouse/touch is down - perhaps making the cursor more opaque while clicking/dragging. CSS can handle the actual fadeout based on the removal of the class. Then if we implement game css, game designers would be able to adjust this behavior with no additional game engine code. This as been previously brought up in #249, #111, & #94.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/virtualtabletop#361
No description provided.