Is there an event to start the keyboard while saving in the Ace editor?

On Mac and Windows, when you press COMMAND + S or CTRL + S, it is usually used to save the document. The Ace editor has a cross-platform event for this, what can I listen to? If not, how can I capture a user-initiated save event?

+5
source share
1 answer

add a command like this

editor.commands.addCommand({ name: 'save', bindKey: {win: "Ctrl-S", "mac": "Cmd-S"}, exec: function(editor) { console.log("saving", editor.session.getValue()) } }) 
+8
source

All Articles