November 2019
Beginner
436 pages
8h 52m
English
With Monaco Editor, you can provide custom commands that handle keyboard combinations. For example, the format of the Open command may look as follows:
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_O, () => { // do something});
Let's create two stubs for the Open and Save functions, which will be handled by the Ctrl + O/Cmd + O and Ctrl + S/Cmd + S commands, respectively:
const editorDidMount = (editor, monaco) => { console.log('editorDidMount', editor, monaco); editor.focus(); ...Read now
Unlock full access