JJ-8 / CTFNote

CTFNote is a collaborative tool aiming to help CTF teams to organise their work. This tool helps making notes during CTFs, so you can track your CTF notes at a later time. This is similar to the CTF pad seen in one of the video's of Liveoverflow.
GNU General Public License v3.0
9 stars 2 forks source link

Custom shortcuts do not work when HedgeDoc editor is focussed #105

Closed markfijneman closed 4 months ago

markfijneman commented 4 months ago

ctrl + k does not work while the HedgeDoc editor is focused. It does work when other parts of HedgeDoc are in focus.

In the HedgeDoc iframe the editor (CodeMirror) can be accessed using the editor variable. Maybe there is an API to add and/or modify custom keybindings there?

markfijneman commented 4 months ago

Running this in the iframe seems to fix it:

editor.setOption('extraKeys', {
    'Ctrl-K': () => {
        parent.postMessage('showSearchDialog', '*');
        return false;
    }
});

Will open a PR later.