Closed 0xdevalias closed 3 months ago
Seems the keybindings are hardcoded in the MenuButton
components' shortcut
prop here:
It might be cool if they were able to read from the same constant as the keybindings themselves, to ensure they remain in sync?
Skimming the related docs:
It looks like you may not be able to read the keybindings 'back' from the return value of editor.addAction
; so you would probably need to separate them into their own const
/etc, assuming there isn't another Monaco API that allows you to read them back later.
Doing it the same as vscode/monaco now: https://github.com/microsoft/vscode/blob/d40dff9ef9aacb8e5226bcf3938c71f4b9543120/src/vs/base/common/platform.ts#L109-L110
Looks good, thanks! :)
Describe the bug
Was just checking out the web IDE again after the following landed:
78
79
And noticed that the 'File' menu says to use
Ctrl+S
to save (and other similar menu items):But this doesn't work on macOS, as the keybinding is actually
Cmd+S
:Expected Behaviour
It would be good if the suggested key bindings in the menu were able to update themselves based on the platform's bindings.
Code
Logs
See Also