KunalBagaria / rustyvibes

A Rust CLI that makes mechanical keyboard sound effects on every key press
https://github.com/kunalbagaria/rustyvibes
MIT License
208 stars 26 forks source link

Fix thread panic on un-mapped keys #9

Closed B0ney closed 2 years ago

B0ney commented 2 years ago

Issue: Some keys such as "ControlRight", "PageDown" , "PageUp" and "media controls" are not given a key-code. The code that handles the "None" branch will cause the spawned thread to panic and no sound will be played.

Solution: To keep the user immersed, un-mapped Keys will fallback to "a".

Additional refactoring: Removed code duplication

KunalBagaria commented 2 years ago

Thanks a lot for this 👍