Is there a way to trigger different actions by pressed down different keys?

After waiting some uncertain time, can I pressing F3 to trigger the action Display "A" and pressing F4 to trigger the action Display "B"?

I've tried exploring action:If Then Else [Keyboard Maestro Wiki] but it seems like there‘s no way to get this solved.

Keyboard Maestro 8.2.2 “Pause Until a Key is pressed” Macro

Pause Until a Key is pressed.kmmacros (20 KB)

Two different macros ?

Each using an 'Execute a macro' action to call some third macro, containing shared data or logic ?

Untitled

@ComplexPoint Thanks for your reply! Maybe I need to get this question more explicit: What I wanna do is wait first for some uncertain time, then decide do thing A or thing B by pressing a button. It seems that 'Execute a macro' action doesn't help here.

I've revised the description of the question and hopefully it will clear now.

Perhaps pause until key a is down or key b is down,

then if key a is down: action X else if key b is down: action Y ?

fixed

  1. Assign all of the triggers to the same macro.
  2. Then use a Switch or Case action to switch on TriggerValue token.

Example:

image


Questions?

@ComplexPoint Cool, It works ! I didn't think of that. Thanks!

1 Like

@JMichaelTX Thanks! It provides a new way to help me combine some of my macros into one.

But it seems that it doesn't meet the need of "After waiting some uncertain time". Anyway, @ComplexPoint got me the solution and helps me out.

Thanks again for both of your kind reply. Nice day :wink: