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

unreachable patterns in linux/inputs.rs scan_code_to_key's match #19

Open
luukvanderduim opened this issue Aug 6, 2020 · 1 comment

Comments

@luukvanderduim
Copy link

Hi!

Cool crate you've written. Thanks!

The compiler complains (rightfully so I guess) that the the match in linux/inputs.rs:130, in function:
pub fn scan_code_to_key(scan_code: u32) -> Option<KeybdKey>
has unreachable patterns.
This is because 0x47, 0x48, 0x4b, 0x4d and 0x50 are used more than once and match has no way to distinguish between them.

These are numpad keys with double functions, depending on the num-lock state? I am not sure how to fix this.

@obv-mikhail
Copy link
Owner

@luukvanderduim Thanks!

I guess these unreachable values should be removed for now to make the warnings go away. But I am also not sure what would need to be done to distinguish between them.. Will need to do some research.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants