You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Give that a check and I think the work at #213 partialy captures the parse_platform logic at https://github.com/napari/napari/blob/main/napari/utils/interactions.py#L312 The missing thing I would say is also being able to parse symbols from non modifier keys like enter, arrows, backspace, delete, tab, space, etc. Could it be worthy to further extend the parsing capabilities to any symbol or representation that os_symbol and os_name can return? From a quick check, maybe extending the KEYCODE_FROM_LOWERCASE_STRING dictionary could be a way to achieve this? So something like:
KEYCODE_FROM_LOWERCASE_STRING: Dict[str, KeyCode] = {
# two special cases for assigning os-specific strings to the meta key'win': KeyCode.Meta,
'cmd': KeyCode.Meta,
# special cases for symbols and other os-specific strings'↵': KeyCode.Enter,
'→': KeyCode.RightArrow,
...
}