Generate Command-*actions

I need to use KM to convert a "%" input to a Command key modified character, in other words, when %F is typed KM would send Command-F. It's simple to just create a Macro for each needed Command, but could I make a single macro that would, upon seeing the % input, sent the next input character with the Command key (i.e. "%5" sends Command-5, "%H" sends Command-H, etc.)?

Thanks

Ugly one:

image

I see how that would work… I’d still have to enter data for each possible key combination, I was hoping to have a solution that would just be able to, after receiving the %, see the next character entered and then send that along with the command key

I have to warn you against this because there are situations in which it simply won't work (because it has to be a typed string trigger). For example, any selection will be immediately erased by invoking this macro.

But it can do things like simulate a Paste (Cmd-V) or Select All (Cmd-A) with a %-key trigger. You might refine it to accept only the keys it works with.

Simulate Command Chord Macro (v9.2)

Simulate Command Chord.kmmacros (2.7 KB)

2 Likes

Thanks. This for a barcode scanner application where previously they were able to program this function into the scanner. We only need about 15 triggers so either individual macros (which seem to work fine), or the previously posted single macro solution will be not too cumbersome. It just made me wonder how to do it more elegantly in KM.