I want to provide keybindings in a curses-based python program. The ideal solution would be to have an abstraction layer around getch()
that yields readable strings, maybe in a vim-like format.
In pythonese:
def get_keycomb(wind):
string = read_keycomb(wind) # read with wind.getch() as needed
return string # something like '<C-S-a>'
Then I could easily implement mappings by using the strings as keys in a dict
function.
Is there a python library that provides this sort of functionality, or an easier way to achieve it than manually providing names for everything?