monaco-editor version: 0.10.1
Browser: Chrome
OS: Windows
Steps or JS usage snippet reproducing the issue:
How can I change triggerSuggest hot key from Ctrl+Space to another key?
Because Ctrl + Space is hot key for Switch Input Method in Chinese Windows.
But I can't find how to change to another. How can I do this?
$(document).on('keydown', function () {
var oEvent = window.event;
if (oEvent.keyCode == 13 && oEvent.altKey) {
triggerSuggest();
}
});
function triggerSuggest() {
monacoEditor.trigger('', 'editor.action.triggerSuggest', {});
}
You can use (change the e.code to whatever you want)
editor.onKeyDown((e) => {
if (e.code === 'Space' && e.ctrlKey === true) {
console.log('YES ! ');
}
});
We're currently not exposing the IKeybindingService which would allow for customization of keyboard shortcuts...
editor.addCommand(monaco.KeyCode.Tab,
() => {
editor.trigger('', 'editor.action.triggerSuggest', '');
},
'editorTextFocus && !editorHasSelection && ' +
'!editorHasMultipleSelections && !editorTabMovesFocus && ' +
'!hasQuickSuggest');
Let's track in #102