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 |
Comparison between different types
Whenever the type of value
is different, it is treated as having different contents.
1
!=true
true
!="true"
Default value
If the variable is not set to a value, the value is treated as0
.
Confirm the current variable values
You can see the current variable values by EventViewer > Variables.
