# Custom hotkeys (key combinations) in monaco command palette

**URL:** https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510
**Category:** General
**Tags:** monaco
**Created:** [23 July 2022 19:27 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510 "2022-07-23T19:27:30Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![ei23](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ei23/32/65111_2.png) [@ei23](https://discourse.nodered.org/u/ei23)
#### Post date: [23 July 2022 19:27 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/1 "2022-07-23T19:27:30Z")

</div>

Hi 3.0 is great so far, so a huge thank you for the great work!  
Since i'm now also switching from ace to monaco, there a some habits that don't want to move so fast 😉  
Sooo is there a possibility to set custom shortcuts (key combinations) for monaco? Maybe in the settings file?!  
For example i was used to crtl + d to delete a line, or ctrl+# for comment a line.  
Would be great to have some custom shortcuts here.

---

<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: [23 July 2022 19:52 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/2 "2022-07-23T19:52:42Z")

</div>

Tbh, it doesn't take too long for the muscle memory to set. Additionally the shortcuts align with vscode so worth relearning. But to answer your question, there was no explicit API method added to permit this. Sorry.

---

<div class="post-metadata">

### Author: ![ei23](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ei23/32/65111_2.png) [@ei23](https://discourse.nodered.org/u/ei23)
#### Post date: [23 July 2022 22:47 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/3 "2022-07-23T22:47:45Z")

</div>

True words! I'm using VSCode with mostly standard settings btw.  
But there are still some drawbacks with german keyboard layout in my case.  
You can't reach the ctrl+/ command for comment lines, for example, since you only can hit the "/" with shift+7 on german layout, so some customization would be useful...  
Or is there a trick for other layouts? I haven't find it yet...

---

<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: [23 July 2022 23:01 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/4 "2022-07-23T23:01:32Z")

</div>

What shortcut do you use in VS code for comment/uncomment by default on a German keyboard? Have you tried that?

If you press F1 and enter the word comment on the command pallet, what shortcut is assigned?

---

<div class="post-metadata">

### Author: ![ei23](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ei23/32/65111_2.png) [@ei23](https://discourse.nodered.org/u/ei23)
#### Post date: [24 July 2022 10:18 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/5 "2022-07-24T10:18:25Z")

</div>

VSCode's default for "Toggle Line Comment" is the same as monaco's `ctrl+/` and you can't use that on DE layouts, so I changed it manually to `ctrl+#` and `ctrl+numpad_divide` in VSCode.

EDIT:  
I just checked the browser version of VSCode and for some reason `ctrl+#` also isn't working there.  
Only `ctrl+numpad_divide` works

---

<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: [24 July 2022 10:25 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/6 "2022-07-24T10:25:04Z")

</div>

What does `ctrl+-` do? (`-` on top row not NUM pad)

---

<div class="post-metadata">

### Author: ![ei23](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ei23/32/65111_2.png) [@ei23](https://discourse.nodered.org/u/ei23)
#### Post date: [24 July 2022 10:27 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/7 "2022-07-24T10:27:45Z")

</div>

`ctrl+-` zooms out  
The `-` and `_` it's next to the right shift button

---

<div class="post-metadata">

### Author: ![ei23](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ei23/32/65111_2.png) [@ei23](https://discourse.nodered.org/u/ei23)
#### Post date: [24 July 2022 10:36 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/8 "2022-07-24T10:36:14Z")

</div>

`ctrl+numpad_divide` for "Toggle Line Comment" hardcoded would be fine for me^^  
It's the only thing i'm missing for german keyboard i think

---

<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: [24 July 2022 11:22 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/9 "2022-07-24T11:22:38Z")

</div>

I thought that was already mapped by default.  
One more... What does `CTRL-#` do in your setup?

---

<div class="post-metadata">

### Author: ![ei23](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ei23/32/65111_2.png) [@ei23](https://discourse.nodered.org/u/ei23)
#### Post date: [24 July 2022 11:27 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/10 "2022-07-24T11:27:29Z")

</div>

> I thought that was already mapped by default.  
> One more... What does `CTRL-#` do in your setup?

Desktop version of VSCode does "Toggle Line Comment"  
Browser version does nothing. If i try to set `ctrl+#` it shows `ctrl+unknown` (Firefox)

---

<div class="post-metadata">

### Author: ![ei23](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ei23/32/65111_2.png) [@ei23](https://discourse.nodered.org/u/ei23)
#### Post date: [24 July 2022 11:33 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/11 "2022-07-24T11:33:07Z")

</div>

And there we go.. It seems to be a Firefox issue!  
`ctrl+#` is working in Chromium 😀

---

<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: [7 August 2022 11:33 UTC](https://discourse.nodered.org/t/custom-hotkeys-key-combinations-in-monaco-command-palette/65510/12 "2022-08-07T11:33:09Z")

</div>

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