Activate global hotkeys in other apps

I want to do something like the following.

For example, suppose I have two macros like this:

Global Macro:
Pressing "⌘ + W" will behave like "Delete"

Macros that only work in XXX app:
Pressing "Delete" will behave like "⌘ + Delete"

In this state, I want to press "⌘ + W" to reach "⌘ + Delete" in the XXX app.

But it doesn't actually respond...
Is it not possible to chain hotkeys beyond the macro classification?

This is my understanding of how this works:

If you press Delete in XXX app, then your app-specific Delete macro will run. But if you press ⌘W in XXX app, then the global macro will send the Delete key to the app, where the app will handle the Delete key as it usually does.

There's a difference between you pressing Delete in the app, and the app receiving the Delete key keystroke. Keyboard Maestro can't interfere in the latter because the keystroke is being sent directly to the app, so your local macro won't ever see that the key was pressed.

In theory, you could work around this by adding logic to the global macro: If frontmost app is XXX, then send Cmd-Delete, otherwise send Delete. But I suspect this won't work for all the situations you want to address, but it's hard to tell without the full context.


1 Like