keymap command RUN outside editor (on lost focus)

Hello. How can I trigger command when focus lost on editor.
I think scope will help me, but I don’t know how can I implement it?
Should I create a scope? Or how can I create scope?

{
    mac: 'Mod-Enter',
    run: (view: EditorView) => {
        // Do something; Also cursor blur;
    },
    // scope: 'editor',
}

A blur event handler, maybe? Though from your code it looks like you’re talking about key bindings. If you want to handle key events when the editor doesn’t have focus, register them on the window or the element that does have focus.