# Any way to add a keyboard entry to ACE/Monaco editor?

**URL:** <https://discourse.nodered.org/t/any-way-to-add-a-keyboard-entry-to-ace-monaco-editor/57463>\
**Category:** Developing Nodes\
**Created:** [29 January 2022 15:38 UTC](https://discourse.nodered.org/t/any-way-to-add-a-keyboard-entry-to-ace-monaco-editor/57463 "2022-01-29T15:38:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 January 2022 15:38 UTC](https://discourse.nodered.org/t/any-way-to-add-a-keyboard-entry-to-ace-monaco-editor/57463/1 "2022-01-29T15:38:30Z")

</div>

Hi all,

I keep triggering my muscle memory for `save` when I'm using the file editor in uibuilder 🧓 I doubt I'm the only person.

So I'd like to add an override for `ctrl-s` when focused on that element. Is there a way of doing this? I've been rather going round in circles looking for an answer.

Thanks. J.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 January 2022 15:56 UTC](https://discourse.nodered.org/t/any-way-to-add-a-keyboard-entry-to-ace-monaco-editor/57463/2 "2022-01-29T15:56:32Z")

</div>

With Monaco ...

Paste this...

```auto
var jsCode = '"use strict";'
var editor = monaco.editor.create(document.getElementById('container'), {
	value: jsCode,
	language: 'javascript'
});

editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, function() {
    //e.preventDefault();
    alert('SAVE pressed!');
});

```

... into the playground : [Monaco Editor Playground](https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-adding-a-command-to-an-editor-instance)

So yes, monaco can bind CTRL+S

However, node-red API does not export this right now. Something to perhaps consider for V3?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 January 2022 16:06 UTC](https://discourse.nodered.org/t/any-way-to-add-a-keyboard-entry-to-ace-monaco-editor/57463/3 "2022-01-29T16:06:23Z")

</div>

Thanks Steve. Definitely would be nice to see custom save handling in v3 - I realise that it isn't really needed for things like the function node, only for nodes that need some kind of external save - uibuilder mostly I suspect but maybe the blockly node?

I was actually hoping that there would be something I could do at the jQuery level. Maybe attaching a keycode event to the parent element? As that would possibly work for both ACE and Monaco.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 March 2022 16:07 UTC](https://discourse.nodered.org/t/any-way-to-add-a-keyboard-entry-to-ace-monaco-editor/57463/4 "2022-03-30T16:07:16Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
