Last Key Press

Is there a way to find out what the last keyboard button press was and to populate that to a variable?

Use case: I'd like to track which of the number buttons were pressed last. From a single macro I'd like to trigger on each of the ten digit buttons. When the macro is triggered I'd like it to populate a variable with which button was pressed. I'd also like that pressed button to be sent to the application.

Since a number key determines the macro to run, you can add to the end of each macro a set variable to action to set the variable to the corresponding number.

I may have misspoke. I'd like to have a single macro which is triggered by multiple keys.

Then inside that macro it'd be aware of which key was pressed, and then able set the variable value to the pressed key, and pass that same key press to the active application.

I'm trying to stay away from making ten different macros for my use case. An in reality it'd be all the number buttons and many of the alpha buttons too.

Ah. Then the TriggerValue should be helpful: