rust-embedded-community / pc-keyboard

PS/2 Keyboard Decoder in Rust
Apache License 2.0
96 stars 28 forks source link

Feature Request: Open up the API to allow access to the internal Modifiers struct from Keyboard #39

Closed iTitus closed 9 months ago

iTitus commented 10 months ago

It would be nice to query the Keyboard directly for the state of the CTRL or the SHIFT keys.

thejpster commented 10 months ago

Sounds reasonable. You probably wouldn't want to let users change those fields, but functions to read the state would be ok. Either one function per modifier, or a function that returns a struct with pub fields so you get it all in one go, atomically. Either would work.

Feel free to send a PR!