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

No getkey()? #1010

Open
cheako opened this issue Jul 5, 2019 · 4 comments
Open

No getkey()? #1010

cheako opened this issue Jul 5, 2019 · 4 comments
Labels
F - question There's no such thing as a stupid one S - api Design and usability

Comments

@cheako
Copy link

cheako commented Jul 5, 2019

To probe for the current state of a key or button.

Edit: Getter for mouse location.

@felixrabe
Copy link
Contributor

felixrabe commented Jul 5, 2019

See the docs: You get events as they happen delivered to the closure you pass to event_loop.run().

Edit: ... If you want to remember some state across events, implementing that is your responsibility.

Maybe we could change this issue to be about including an example for this pattern.

@cheako
Copy link
Author

cheako commented Jul 8, 2019

@felixrabe What about access to the current keyboard state, XkbGetState() for example.

@goddessfreya goddessfreya added S - api Design and usability F - question There's no such thing as a stupid one labels Jul 8, 2019
@ryanisaacg
Copy link
Contributor

The ability to check a key isn't available on all Winit platforms (e.g. web) so the API doesn't expose a way to do it.

@felixrabe
Copy link
Contributor

felixrabe commented Jul 12, 2019

It could be a candidate for adding to a platform-specific extension trait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F - question There's no such thing as a stupid one S - api Design and usability
Development

No branches or pull requests

4 participants