Skip to content

Expand keybind parsing options from string #209

@jni

Description

@jni
  • app-model version: 0.2.7
  • Python version: 3.11
  • Operating System: macOS

Description

It would be useful to have a more lenient parser, as long as it's unambiguous, so that OS-specific keybindings can be written out more easily. Specifically, it would be good if SimpleKeyBinding.from_str/app_model.types._keys._keybindings._parse_modifiers could account for:

Control vs Ctrl (maybe even vs ^, though I'm less interested in that)
Cmd vs Command
Alt vs Option

What I Did

In [16]: str(KeyBinding.from_str('Command-Y'))
Out[16]: ''

In [17]: str(KeyBinding.from_str('Control-Y'))
Out[17]: ''

In [18]: str(KeyBinding.from_str('Option-Y'))
Out[18]: ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions