to event definition
{
"key_code": "The name of key_code",
"consumer_key_code": "The name of consumer_key_code",
"pointing_button": "The name of pointing_button",
"shell_command": "shell command",
"select_input_source": {
"language": "language regex",
"input_source_id": "input source id regex",
"input_mode_id": "input mode id regex"
},
"set_variable": {
"name": "variable name",
"value": "variable value"
},
"mouse_key": mouse_key definition,
"sticky_modifier": sticky modifier definition,
"software_function": software function definition,
"modifiers": [
modifier,
modifier,
...
],
"lazy": false,
"repeat": true,
"halt": false,
"hold_down_milliseconds": 0
}
Note
The following keys are exclusive.
You cannot specify multiple items into one to
entry.
key_code
consumer_key_code
pointing_button
shell_command
select_input_source
set_variable
mouse_key
sticky_modifier
software_function
(software_function
is available since Karabiner-Elements v13.5.1)
Name | Required | Description |
---|---|---|
key_code |
Optional | Key code which you want to post |
consumer_key_code |
Optional | Consumer key code (media key code) which you want to post |
pointing_button |
Optional | Pointing button name which you want to post |
shell_command |
Optional | Shell command which you want to execute |
select_input_source |
Optional | Input source which you want to switch |
set_variable |
Optional | A varaible name and value which you want to change |
mouse_key |
Optional | A mouse key definition |
sticky_modifier |
Optional | A sticky modifier key definition |
software_function |
Optional | A software function definition |
modifiers |
Optional | Modifiers which are post with the event |
lazy |
Optional | Lazy modifier flag |
repeat |
Optional | Key repeat flag |
halt |
Optional | A flag for to_after_key_up |
hold_down_milliseconds |
Optional | Interval of key_down and key_up when these events are sent at the same time |
Investigate key names
- You can find
key_code
,consumer_key_code
andpointing_button
names by EventViewer. - You can also confirm names in list.
(See
"data"
in the list.)
Tip
You can also specify key_code
, consumer_key_code
, pointing_button
with raw number as follows.
{
"to": [
{
"key_code": 41
}
]
}