{"action":"created","issue":{"url":"https://api.github.com/repos/tomaka/glutin/issues/820","repository_url":"https://api.github.com/repos/tomaka/glutin","labels_url":"https://api.github.com/repos/tomaka/glutin/issues/820/labels{/name}","comments_url":"https://api.github.com/repos/tomaka/glutin/issues/820/comments","events_url":"https://api.github.com/repos/tomaka/glutin/issues/820/events","html_url":"https://github.com/tomaka/glutin/pull/820","id":185624905,"number":820,"title":"Add event `HasMouse(bool)` for mouse entering/leaving window","user":{"login":"AndyBarron","id":3630243,"avatar_url":"https://avatars.githubusercontent.com/u/3630243?v=3","gravatar_id":"","url":"https://api.github.com/users/AndyBarron","html_url":"https://github.com/AndyBarron","followers_url":"https://api.github.com/users/AndyBarron/followers","following_url":"https://api.github.com/users/AndyBarron/following{/other_user}","gists_url":"https://api.github.com/users/AndyBarron/gists{/gist_id}","starred_url":"https://api.github.com/users/AndyBarron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndyBarron/subscriptions","organizations_url":"https://api.github.com/users/AndyBarron/orgs","repos_url":"https://api.github.com/users/AndyBarron/repos","events_url":"https://api.github.com/users/AndyBarron/events{/privacy}","received_events_url":"https://api.github.com/users/AndyBarron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-27T10:02:19Z","updated_at":"2016-10-29T07:08:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tomaka/glutin/pulls/820","html_url":"https://github.com/tomaka/glutin/pull/820","diff_url":"https://github.com/tomaka/glutin/pull/820.diff","patch_url":"https://github.com/tomaka/glutin/pull/820.patch"},"body":"This change adds a new event, `HasMouse(bool)`, and implements it for all platforms with mouse support (Windows, Cocoa, X11, and Wayland).\r\n## Notes\r\n* The event name is open to bikeshedding.\r\n* I only tested this by making sure it builds successfully on Windows and Linux, so Cocoa is currently untested (but it's a *very* minor change there).\r\n* I'm unsure how acquiring the mutex on every mouse movement will perform on Windows, but I couldn't think of a better way to track whether the mouse was in the window...\r\n\r\n## Other options\r\nI considered implementing two separate events, `MouseLeft` and `MouseEntered(i32, i32)`, to better represent the mouse entering the window. I'm not sure if X11 and Cocoa support this; if we can confirm that they do, we can reconsider.\r\n\r\nUltimately, I want to get the [`Cursor(bool)` event](http://docs.piston.rs/piston/input/enum.Input.html) working on Piston's glutin back-end, which was another reason for implementing `HasMouse` with just a `bool`."},"comment":{"url":"https://api.github.com/repos/tomaka/glutin/issues/comments/257075935","html_url":"https://github.com/tomaka/glutin/pull/820#issuecomment-257075935","issue_url":"https://api.github.com/repos/tomaka/glutin/issues/820","id":257075935,"user":{"login":"tomaka","id":1412254,"avatar_url":"https://avatars.githubusercontent.com/u/1412254?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaka","html_url":"https://github.com/tomaka","followers_url":"https://api.github.com/users/tomaka/followers","following_url":"https://api.github.com/users/tomaka/following{/other_user}","gists_url":"https://api.github.com/users/tomaka/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaka/subscriptions","organizations_url":"https://api.github.com/users/tomaka/orgs","repos_url":"https://api.github.com/users/tomaka/repos","events_url":"https://api.github.com/users/tomaka/events{/privacy}","received_events_url":"https://api.github.com/users/tomaka/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T07:08:00Z","updated_at":"2016-10-29T07:08:00Z","body":"> I considered implementing two separate events, MouseLeft and MouseEntered(i32, i32), to better represent the mouse entering the window. I'm not sure if X11 and Cocoa support this; if we can confirm that they do, we can reconsider.\r\n\r\nI prefer this option.\r\n"}}
{"actor":{"display_login":"tomaka"}}