Hi Team,
I understand that binding a single key can be easily achieved using this following code:
var myBinding = editor.addCommand(monaco.KeyCode.F9, function() {
alert('F9 pressed!');
});
However is it also possible to bind multiple key code such as Ctrl+S for save?
Within monaco.d.ts I found that the addCommand editor within the IStandaloneCodeEditor only receives a single number keybinding:
export interface IStandaloneCodeEditor extends ICodeEditor {
addCommand(keybinding: number, handler: ICommandHandler, context: string): string;
createContextKey<T>(key: string, defaultValue: T): IKeybindingContextKey<T>;
addAction(descriptor: IActionDescriptor): void;
}
I might have reading it wrong since I also found that the right click context menu shown some key combination code:

Thanks
You bitwise OR them together:
var myBinding = editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, function() {
alert('SAVE pressed!');
});
Though look at Issue #25 if you are working with Firefox and issuing an alert. :)
Thanks for your help @ptyork
Most helpful comment
You bitwise OR them together:
Though look at Issue #25 if you are working with Firefox and issuing an alert. :)