Keystroke Logger (Mac Keyboard)

This macro logs any key that is pressed to a variable then deletes it after how ever many seconds you choose. It uses a semaphore lock with a 4 second time out to prevent the macro from looping and having more than 2 instances of the macro from running. This for a British Mac Keyboard. but you can easily use the example to add any other keystroke you'd like.

This is only a keystroke logger, with no actions. You have integrate it into your own actions

Some things this macro can be used

Key Press Condition
You can use this to set conditions to macros for when a key is pressed and not just the default key is down or up conditions, because with the key down condition a key has to be held for a little bit, and it won't recognize and short presses.

Pause macro until any key is pressed

use the pause until condition is met, and selected variable condition, and set it to until key logger variable is not empty.

Keyboard freezer, prevent anything from being typed in pop up dialog boxes

I will post the macro I made for this, but in short it used the Pause until variable is empty(until not keys pressed) before your pop up Window action so if you're typing, your pop up will wait for you to get done type before it pops up.

it doesn't actually freeze the keyboard, but it does give the same result in this specific case, prevents anything from being typed in a pop up dialogue

I have not figured out how to put modifiers and function keys here yet using typed string trigger, so I may just have to use the hot key trigger for those, then simulate the keystroke to front application so it doesn't lose its functionality. The problem with that is for the functions keys they would try to trigger the normal functions and this macro.

Key Logger Example.kmmacros (98.3 KB)