idea: add user-facing rendering to keybindings
in napari, we use a system to render shortcuts with special characters (e.g. the Mac Command symbol for Cmd). I’m on my phone right now so it’s hard for me to show what I mean but I hope you understand the gist
I was thinking that this sort of almost “text rendering” should belong in app-model since I imagine it has a pretty common use case
what do you think @tlambert03? I’d like to work on this but wanted to check first if people like the idea
Yeah, that makes sense! I think it could belong here too. Feel free to flesh out the proposal a bit!
it would essentially entail a method on SimpleKeyBinding and KeyBinding with a signature like this:
def to_text(self, os: OperatingSystem = None, use_symbols: bool = False) -> str:
if no os is provided, it uses the current one
if use_symbols is True, then it will sub in the unicode characters I was talking about, otherwise in the case of e.g. on Mac, Meta -> Cmd, on Win, Meta -> Win, and on Unix, Meta -> Super
ah, great, yeah i love it