Skip to content

Simulate Macro

This type is used to simulate complex keyboard macros. You can use this to automate tasks that require multiple keyboard shortcuts or key presses in sequence. You can specify a delay between each key press if there is a need for it.

You can use the menu editor to record a complete macro and edit the recorded events if needed. See Valid Key Names for details on the format of the individual key names.

The Delayed Option

The item has an optional Delayed property which can enable or disable. If enabled, the macro will be executed after the Kando window is closed. This can be useful if the macro targets another window which needs to be focused.

Example Configuration

If you happen to edit your menus.json file by hand, you can create a Macro item with something like the following. You can read more about the structure of the menus.json file in its documentation.

The data property of the menu item must contain a macro property which contains a list of keyboard events to simulate. The optional delayed property will ensure that the hotkey is executed after the Kando window is closed.

For instance, this menu item will type “Hi” on most keyboard layouts:

menus.json
// ...
{
"type": "macro",
"data": {
"macro": [
{
"type": "keyDown",
"key": "ShiftLeft",
"delay": 10
},
{
"type": "keyDown",
"key": "KeyH",
"delay": 10
},
{
"type": "keyUp",
"key": "KeyH",
"delay": 10
},
{
"type": "keyUp",
"key": "ShiftLeft",
"delay": 10
},
{
"type": "keyDown",
"key": "KeyI",
"delay": 10
},
{
"type": "keyUp",
"key": "KeyI",
"delay": 10
}
],
"delayed": true
},
"name": "Hello World",
"icon": "keyboard_keys",
"iconTheme": "material-symbols-rounded"
},
// ...