-
Notifications
You must be signed in to change notification settings - Fork 2
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
"oncapturedmousechange" vs addEventListener "mousemove"/"mouseclick"/etc #1
Comments
Defining |
Ahh, didn't realise that! So the event name would be "capturedmousechange"? Similar question then, any benefit in aligning it more with the existing mouse events like mousemove, mouseclick? |
Could you clarify what you mean by aligning it more closely with existing mouse events? It is currently modelled after this event. Note that it could then be easily extended to include additional information (modifier keys, buttons) if we get consensus that it's safe. |
Mostly calling it "mousechange" vs "mousemove" I guess. Or am I missing an existing mousechange event somewhere. Other than that I think it's good. |
I'm flexible with names. Whatever the consensus happens to be is fine by me. Generally speaking.
What's the alternative? |
Cool, then my vote goes for naming it after the existing events like (captured)mousemove, (captured)mouseclick, etc. Devs looking for the events will have an easier time finding it if it's something they already used in other places.
Using "screen" instead of "surface", since screen is already used by mousemove: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/screenX |
Would you like 5-10 minutes to present about this in the next SCCG meeting?
What if the surface being captured is a tab? Or a window? "Screen" would be misleading then. |
Sure, I can put some options on a slide and discuss :)
Ok hadn't thought about that. I see that getDisplayMedia also calls it "surface" everywhere, in that case it makes sense. |
Regarding support for |
Fixing #9 provided the addEventListener/removeEventListener/dispatchEvent with event type "capturedmousechange" Not sure if the discussions around "mousemove"/"mouseclick" is addressed though. |
I think an event that delivers the entire new state, allows firing a single event even when two events happen at the same time. It also allows the browser the flexibility to employ optimizations that buffer and batch events. I therefore prefer a single "x-changed" over a set of ("x-moved", "x-clicked", "x-scrolled"). (The option of presenting a different view is always available either here or in the CG meetings.) |
So reading this issue again, the problems raised were:
So only 3. remains. As I commented #2 (comment) I would suggest either to open a separate issue or to change the title, so it's easier to understand what the issue is about when reviewing the list of open issues. If we decide this is something for the future, I'd also use the discussed approach with labels so we can forget about it from the time being. I guess we can probably first discuss this in the CG. Personally as an implementer I agree with what Elad said in his last comment and also that allows to minimize the number of event types / interfaces. But I also guess it won't be too difficult to make |
We discussed naming in a CG meeting a while back, I think we didn't really feel strongly about picking one vs another so I think we can start with "capturedmousechange". |
I'm glad we've reached consensus. :-) |
I was curious why the proposal was made to have a callback "oncapturedmousechange" instead of a more common API like addEventListener. I could see us wanting to support multiple types of events, maybe even keyboard events (out of scope for this proposal I know :)), and a more general event listener approach could make sense for that?
For example:
Would like to better understand the choice for the callback in the proposal, thanks.
The text was updated successfully, but these errors were encountered: