-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[monaco] Fix keybindings on os x #3835
Conversation
@kittaakos could you check on windows as well? |
@@ -79,7 +79,7 @@ export class MonacoKeybindingContribution implements KeybindingContribution { | |||
first: Key.getKey(monaco2BrowserKeyCode(keyCode & 255)), | |||
modifiers: [] | |||
}; | |||
if (keybinding.ctrlKey) { | |||
if (keybinding.metaKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with this change, we never add Ctrl to the sequence in Windows... I am verifying it anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We rely on the mapping logic from monaco:
https://github.com/Microsoft/vscode/blob/master/src/vs/base/common/keyCodes.ts#L428
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic should be something like this
IF OS === macOS AND isMeta AND isCtrl
then it is aCtrlCmd
IF OS === macOS AND !isMeta AND isCtrl
the it is aMacCtrl
(this should not do anything on Windows)IF OS !== macOS AND isCtrl
then it is aCtrlCmd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. So it is already handled by monaco. Thanks for the clarification.
oh, how convenient :-) |
Fixes #3834 Signed-off-by: Sven Efftinge <[email protected]>
10810a0
to
5ed0803
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified the changes on Windows with the browser example. It worked. 👍
Fixes #3834
Signed-off-by: Sven Efftinge [email protected]