textual
textual copied to clipboard
Clean up `keys.py` and unify key representations/versions
The file keys.py contains some important constants and utility functions that are a bit hard to work with.
In my opinion, that is because we have not created a straightforward system to identify keys, their display forms, the names by which they can be referred, the corresponding characters, etc.
(Of course, this is not made easy by the fact that the type of pretty much all of these things is str...)
Some documentation would also be helpful.
I am confident I can tidy this up, but I'm adding this issue to the backlog so that we can tackle this when we are ready for that.
This is a follow-up to #1926 (and related issues).
Related to work @davep is doing now.
Keys are messy. Not sure we can do much about it now. But at least from the dev's POV it seems simple enough.