Create a variable to store which keystroke you want to type

You open a new world to me. I did some tests and find I can use key code to describe different modifier type in XML code. Then use your way to do script in KM.

ctrl+opt+cmd+shift 6912
ctrl 4096
ctrl+opt 6144
ctrl+cmd 4352
ctrl+shift 4608
ctrl+opt+cmd 6400
ctrl+cmd+shift 4864
opt 2048
opt+cmd 2304
opt+shift 2560
opt+cmd+shift 2816
cmd 256
cmd+shift 768
Shift 512
NULL 0

I make a handler macro, like a function. I create variable thisKeyCode to describe the character key you want to type. Create variable thisModifierCode to describe the modifier type you want to type.


In any KMMacro, as long as you set these two variables at the beginning, you can use execute a macro to call this handler macro(function).

When you want to change to another keystroke, you only need to change the two variables at the head of the macro.
Completely new way to me. Many thanks.
handler use variable pass keystroke v0_Backup_20220426_1031_v0.kmmacros (122.9 KB)

1 Like