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

Second field of Event::KeyboardInput(..) is undocumented #662

Closed
HeroesGrave opened this issue Nov 19, 2015 · 3 comments
Closed

Second field of Event::KeyboardInput(..) is undocumented #662

HeroesGrave opened this issue Nov 19, 2015 · 3 comments

Comments

@HeroesGrave
Copy link

It's just a u8 with no description or even field name.

In fact, the docs for the Event enum are overall rather lacking.

ReceivedCharacter is another one that sticks out as mysterious. Under what circumstances does that event get fired? How does it relate to the KeyboardInput event being fired? etc.

@Kasran
Copy link

Kasran commented Jun 9, 2016

I can at least say that the u8 field of KeyboardInput is the scan code of the key for which the event is being reported, which you can use to identify the key being pressed even when the third field is None (so you can't check what key it is by its VirtualKeyCode). (I think in current documentation it's labeled as a ScanCode, but there's still no explanation for it past that.)

I'm also wondering about ReceivedCharacter, though.

@LFalch
Copy link

LFalch commented Jun 9, 2016

ReceivedCharacter is the character that you have typed. For instance, if you held shift and pressed H, you'd get a capital H. Basically, it's like what you'd get, if you were typing into a textbox.

@tomaka
Copy link
Contributor

tomaka commented Nov 3, 2016

Closing for rust-windowing/winit#61

@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

4 participants