pyfisch / keyboard-types

Types to define keyboard related events.
Apache License 2.0
54 stars 9 forks source link

String to Key #3

Closed dbrgn closed 4 years ago

dbrgn commented 5 years ago

There's no function to get a Key from a &str, right? Do you plan to add such a function?

It could probably easily be generated by using convert.py and linear search, falling back to Key::Character if none of the other keys matches.

pyfisch commented 5 years ago

No there is currently no function to get a Key from a &str mainly it is not needed for the Servo browser. Servo only converts typed Keys to strings but not the other way around.

As you say it would be easy to add by modifying convert.py. Do you have a project that needs this function? I would be glad to add it.

Notes:

pyfisch commented 4 years ago

Closed by #4