Design of cursor visibility and cursor position API #1885
Replies: 2 comments 14 replies
-
First off - I'll flag that broadly speaking, I'm not a huge fan of the general idea of cursor control APIs. From a UX perspective, apps should keep their hands off the position of the cursor; and the only time an app should care about the position of a cursor is (a) the position at the time of a click event on a widget like a canvas, and (b) enter/exit region events. Broad cursor visibility is also needed for use cases like full screen presentation apps - but outside that sort of case, apps should not be making the cursor arbitrarily invisible. The cursor is a key UX element. Making that element invisible is, generally speaking, a bad UX move. Continuing specific discussion points from #1864:
I've also had an in-person discussion with @mhsmith; and he made the good point that cursor visibility is arguably a style question. In CSS, cursor is a property that can control both which cursor is used when hovering over a widget, as well as hiding the cursor on a per-widget basis. In terms of the specific API proposal - you've covered the public interface API; but there's no mention of the backend API. However it's probably better to wait until we have a concrete public interface before we work out how the backends will implement that API. |
Beta Was this translation helpful? Give feedback.
-
The true use of cursor position system would be to detect hover over a widget and do some operations during that event, like it's done in CSS. Addressing the questions: 1.Yes, there is only 1 cursor but there will be multiple windows:
While you could do:
But, clearly the second approach is more verbose. This is not a new idea. Most of the toolkits provide both the window relative and global cursor positioning API. Maybe I am not the most qualified one to suggest use cases for this API but clearly there is a need for such API, hence they exist in most toolkits. 2.Apps contain windows. Apps are not windows. Hiding the cursor app wide will be a bad UX decision as the user won't be able to differentiate between a non responding app and a app that doesn't want to take user interaction. cursor visibility on an window basis provides more fine grained control to the developer. They can choose to show/hide cursor on a specific window or hide entirely for all the windows of their app. Use case for window level cursor visibility would be an app having multiple windows and the developer wants to hide the cursor on a specific window, rather than app wide. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As per our discussion until now, here is what I think the API should look like:
Window by Window Basis:
App wide Basis:
Here, I can see the usefulness of exposure of
cusor_visibility
andcursor_position
both as window basis and app wide basis.cursor_visibility
on a window basis can allow the users to interact with the other windows of the app while preventing interaction on a particular window.cursor_visibility
on an app wide basis can allow the developers to prevent user interaction for the whole app. This is useful when the app doesn't want the user to do something while a process or task is running which would be hampered by any user interaction.cursor_position
on a window basis can be used to implement a "first time app use guide". This would allow the developer to move the cursor to a particular position to point out a feature on the app. This would be useful as the app developer would want to move the cursor with respect to particular window on which the feature is located.cursor_position
on an app wide basis can be used to point out certain things on the user's screen which is not related to the app itself, like a feature on the user's system.@freakboy3742 Let me know how do you feel about this.
Beta Was this translation helpful? Give feedback.
All reactions