Hi,
First of all, thank you all for developing and maintaining muda. We are happily using it in Slint for our native menu bars and context menus. 😊
Recently we ran into the limitation that muda only allows creating accelerators based on keyboard-types Code type, which doesn't allow expressing all keyboard shortcuts that Slint supports.
Concretely, the Code type is limited to physical key codes, even though accelerators usually use "logical" keys - e.g. the string that was produced by the keypress, not the physical key position.
That means that Muda currently does not support keyboard shortcuts like Control + +/Control + {/Control + €, etc.
I would like to contribute to muda to add support for these kinds of keyboard shortcuts.
In my opinion the right approach is to add support for the Key type from keyboard-types instead of the Code type.
Key is the right type because it represents a logical keypress that produced a certain string instead of a physical key position.
Ideally, I think accelerators should entirely migrate to using the Key type, but I can understand that for backwards compatibility it is probably better to continue offering the constructor that accepts a Code.
Would you consider merging a pull request that adds an additional constructor for accelerators that use the Key type?
Also, would you prefer keeping the existing Code constructor, or remove it entirely?
Hi,
First of all, thank you all for developing and maintaining muda. We are happily using it in Slint for our native menu bars and context menus. 😊
Recently we ran into the limitation that muda only allows creating accelerators based on keyboard-types
Codetype, which doesn't allow expressing all keyboard shortcuts that Slint supports.Concretely, the
Codetype is limited to physical key codes, even though accelerators usually use "logical" keys - e.g. the string that was produced by the keypress, not the physical key position.That means that Muda currently does not support keyboard shortcuts like
Control + +/Control + {/Control + €, etc.I would like to contribute to muda to add support for these kinds of keyboard shortcuts.
In my opinion the right approach is to add support for the
Keytype from keyboard-types instead of theCodetype.Keyis the right type because it represents a logical keypress that produced a certain string instead of a physical key position.Ideally, I think accelerators should entirely migrate to using the
Keytype, but I can understand that for backwards compatibility it is probably better to continue offering the constructor that accepts aCode.Would you consider merging a pull request that adds an additional constructor for accelerators that use the
Keytype?Also, would you prefer keeping the existing
Codeconstructor, or remove it entirely?