variable_if, variable_unless

Change an event if/unless the variable is the specified value.

Example


Specification

{
    "type": "variable_if",
    "name": "variable name",
    "value": variable value
}
Name Required Description
type Required "variable_if" or "variable_unless".
name Required Target variable name.
value Required Target variable value.
description Optional A human-readable comment

Available types of value

Type Example value Available since
integer 0,1,2,… Karabiner-Elements 11.0.0
boolean true, false Karabiner-Elements 14.4.20
string “layer1”, “layer2” Karabiner-Elements 14.4.20

Confirm the current variable values

You can see the current variable values by EventViewer > Variables.

eventviewer-variables@2x.png

System variables

Some variables are automatically set by Karabiner-Elements.

Name Type Data source Available since
system.scroll_direction_is_natural boolean The scroll direction setting of mouse in System Settings Karabiner-Elements 15.2.3
system.use_fkeys_as_standard_function_keys boolean The “Use all F1, F2, etc. keys as standard function keys” setting in System Settings Karabiner-Elements 15.2.3