-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event improvements #56
Comments
That sound like a good idea!
Mmm ... I'm not sure, tbh. I think my reasoning was that apps use pointer-down more often than click, while double-click can be used to implement specific functionality. I suppose adding a click event would make sense for completeness.
Whatever the system/browser defines it as - the implementation in jupyter_rfb uses the standard dblclick event. |
Great, then we can implement that!
Well, the reason I bring this up is because I see some trouble with click events in jupyter-rfb. The value of a click event lies in its definition (emphasis mine):
This is a beautiful definition since it makes it easy for applications to differentiate between "drags" and "clicks". However, applications which don't have access to click events, but only pointer down/move/up, still need to differentiate "clicks" and "drags". So they typically use something like the mouse movement between pointer down and up as a heuristic, but that doesn't always work as a user would expect it to (since it does not align with the definition above which is the standard behavior in the browser and in native desktop interfaces). Getting to the point now, jupyter-rfb events (and wgpu canvas events) are always defined on a single element (the canvas). So you can't really implement the above definition. There is only one element, so every "drag" is also always a "click". So I'm thinking, click, and double click, can be implemented in higher level libraries which do have an idea of what "elements" are represented in the canvas (such as pygfx and vispy), but not at this high level. Therefore, I don't think click/double click really have a place in jupyter-rfb. What do you think? |
Good point about there always being one element from the canvas point of view. That, and because quite often there will be some sort of elements in the scene, makes the default click and dblclick useless indeed. I see two options:
The advantage of the latter is that it's a reasonable solution that apps can use directly. Apps that want to have something based on their own definition of elements can easily ignore and re-define these events. |
Another thing: the spec for wheel events does not say anything about button or buttons. These values could come in handy though, just like the modifiers. |
Not sure why I did not spot this earlier, but the keys in the In #78 I clarify this in the events spec. An also cover the other cases mentioned in this issue. |
Based on previous experience with (pointer, mouse and keyboard) events in browsers, I think it would behoove the event specification and implementation to be expanded a little:
touches
event property is useless as you can't tell from the event which pointer an event corresponds to (unless you do some rather involved bookkeeping).buttons
in wheel events (added by AK).I have some questions as well:
The text was updated successfully, but these errors were encountered: