Allow global/document-level keymaps (prevent CodeMirror from intercepting)

Hi I’m using useHotkeys() from Mantine for example to handle some keymaps that are outside of CodeMirror. For instance, closing sidebars with Cmd+B. Or opening a command palette using Cmd + Shift + P.

Currently, none of my hotkeys work at all whenever my cursor is focused inside CodeMirror. I’d like to allow most of these hotkeys. I’d rather not redefine every hotkey as an extra extension like:

          keymap.of([{ key: 'a', run: handleEnter }]),

Is this possible?

Hi guys, sorry for the false alarm. So it wasn’t actually codemirror’s issue.

I forgot that useHotkeys() has an extra option called triggerOnContentEditable. Source: https://mantine.dev/hooks/use-hotkeys/

So I just needed to set that to true and my hotkeys are being called even when focusing on CodeMirror. That’s pretty cool.

Not really CodeMirror related but if anyone’s using Mantine and CodeMirror, I guess this forum thread is useful? Hope that helps.