Skip to content
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

Add mouse enter/leave events #570

Closed
bvssvni opened this issue Aug 14, 2015 · 7 comments
Closed

Add mouse enter/leave events #570

bvssvni opened this issue Aug 14, 2015 · 7 comments

Comments

@bvssvni
Copy link
Contributor

bvssvni commented Aug 14, 2015

This is a requested feature when you are dragging something and the cursor moves outside the window. On Linux and Windows the window stops emitting mouse coordinates. When returning to the window this can lead to undesirable behavior.

See PistonDevelopers/piston#958 for discussion.

@bvssvni
Copy link
Contributor Author

bvssvni commented Aug 15, 2015

@cybergeek94 you mentioned that only leave events could be added in WinAPI. Is this right?

@abonander
Copy link
Contributor

As far as I can tell, yes. There's the WM_MOUSELEAVE message but no corresponding WM_MOUSEENTER message.

It looks like a mouse-entered message is supposed to be implied when you start getting WM_MOUSEMOVE messages again after WM_MOUSELEAVE: http://blogs.msdn.com/b/oldnewthing/archive/2003/10/13/55279.aspx

@wolfiestyle
Copy link

On Linux, X11 generates both events natively: https://tronche.com/gui/x/xlib/events/window-entry-exit/

@elinorbgr
Copy link
Contributor

@andybarron
Copy link

I'm going to take a stab at this.

I'm thinking of adding a MouseLeft event and letting MouseMoved imply it re-entered on all platforms. MouseWindow(bool) is cleaner, but kind of a pain in Windows...

Thoughts?

@andybarron
Copy link

The more I think about it, the more I like leaving MouseLeft as its own event. It avoids getting two events (e.g. MouseWindow(true) and MouseMoved(x, y)) when the mouse enters the window.

@tomaka
Copy link
Contributor

tomaka commented Nov 3, 2016

Closing for rust-windowing/winit#53

@tomaka tomaka closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants