Need simple Num Lock macro

How to make macro for num lock action? Playing game I want macro so when I press key combo of ' option & command' and a number (1-4) it will lock the number and keep repeating it. Also combo of 'option & command' and (0) will end the macro. Your help is much appreciated.

thanks for all your help LOL. No worries I found a solution. Thanks Hammerspoon

Your title might have stopped people replying -- "Num Lock" is a particular keyboard key/action that can't (AFAIK) be emulated in Keyboard Maestro.

The "repeat a key-press" is easy enough -- here's an example for the 1 key:

Repeat 1-key.kmmacros (2.6 KB)

You can change the "Pause" time to adjust the repeat speed.

You could make a macro, based on the above, for each number. And to stop the repeats you could simply "Cancel All Macros". But that's no fun! So here's a single macro that will let you change the number being repeated as well as cancel just the repeater macro (other macros will keep going) with ⌥⌘0:

Repeat 1-4 keys.kmmacros (11.9 KB)

Image

There's nothing particularly tricky about the macro, but ask if you've any questions.