HactarCE / key-names

Platform-aware keyboard key name handling for Rust applications
Apache License 2.0
5 stars 5 forks source link

Suggestion: Implement Parse #3

Open cozyGalvinism opened 2 years ago

cozyGalvinism commented 2 years ago

I think a nice addition would be to allow for parsing of keys via String so:

a will return the a key, ctrl+c will return the c key with CTRL modifier and so on.

HactarCE commented 2 years ago

There's several different formats for writing keybinds:

In my original design for this lib, I thought about supporting ser/deser for each of these formats, but decided against it because it's highly application-specific and I didn't need it. I'm curious what would be most useful for your application, and whether it's possible to just serialize a struct with modifiers and a key like I do here.