config: allow handling switch events
This commit is contained in:
parent
55d55bf161
commit
cf233abb5a
21 changed files with 443 additions and 27 deletions
|
|
@ -825,6 +825,22 @@
|
|||
"keymap": {
|
||||
"description": "The keymap to use for this device.\n\nThis overrides the global keymap. The keymap becomes active when a key is pressed.\n\n- Example:\n\n ```toml\n [[inputs]]\n match.name = \"ZSA Technology Labs Inc ErgoDox EZ\"\n keymap.name = \"external\"\n ```\n",
|
||||
"$ref": "#/$defs/Keymap"
|
||||
},
|
||||
"on-lid-closed": {
|
||||
"description": "An action to execute when the laptop lid is closed.\n\nThis should only be used in the top-level inputs array.\n\n- Example:\n\n ```toml\n [[inputs]]\n match.name = \"<switch name>\"\n on-lid-closed = { type = \"configure-connector\", connector = { match.name = \"eDP-1\", enabled = false } }\n on-lid-opened = { type = \"configure-connector\", connector = { match.name = \"eDP-1\", enabled = true } }\n ```\n",
|
||||
"$ref": "#/$defs/Action"
|
||||
},
|
||||
"on-lid-opened": {
|
||||
"description": "An action to execute when the laptop lid is opened.\n\nThis should only be used in the top-level inputs array.\n\n- Example:\n\n ```toml\n [[inputs]]\n match.name = \"<switch name>\"\n on-lid-closed = { type = \"configure-connector\", connector = { match.name = \"eDP-1\", enabled = false } }\n on-lid-opened = { type = \"configure-connector\", connector = { match.name = \"eDP-1\", enabled = true } }\n ```\n",
|
||||
"$ref": "#/$defs/Action"
|
||||
},
|
||||
"on-converted-to-laptop": {
|
||||
"description": "An action to execute when the convertible device is converted to a laptop.\n\nThis should only be used in the top-level inputs array.\n",
|
||||
"$ref": "#/$defs/Action"
|
||||
},
|
||||
"on-converted-to-tablet": {
|
||||
"description": "An action to execute when the convertible device is converted to a tablet.\n\nThis should only be used in the top-level inputs array.\n",
|
||||
"$ref": "#/$defs/Action"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -1635,6 +1635,56 @@ The table has the following fields:
|
|||
|
||||
The value of this field should be a [Keymap](#types-Keymap).
|
||||
|
||||
- `on-lid-closed` (optional):
|
||||
|
||||
An action to execute when the laptop lid is closed.
|
||||
|
||||
This should only be used in the top-level inputs array.
|
||||
|
||||
- Example:
|
||||
|
||||
```toml
|
||||
[[inputs]]
|
||||
match.name = "<switch name>"
|
||||
on-lid-closed = { type = "configure-connector", connector = { match.name = "eDP-1", enabled = false } }
|
||||
on-lid-opened = { type = "configure-connector", connector = { match.name = "eDP-1", enabled = true } }
|
||||
```
|
||||
|
||||
The value of this field should be a [Action](#types-Action).
|
||||
|
||||
- `on-lid-opened` (optional):
|
||||
|
||||
An action to execute when the laptop lid is opened.
|
||||
|
||||
This should only be used in the top-level inputs array.
|
||||
|
||||
- Example:
|
||||
|
||||
```toml
|
||||
[[inputs]]
|
||||
match.name = "<switch name>"
|
||||
on-lid-closed = { type = "configure-connector", connector = { match.name = "eDP-1", enabled = false } }
|
||||
on-lid-opened = { type = "configure-connector", connector = { match.name = "eDP-1", enabled = true } }
|
||||
```
|
||||
|
||||
The value of this field should be a [Action](#types-Action).
|
||||
|
||||
- `on-converted-to-laptop` (optional):
|
||||
|
||||
An action to execute when the convertible device is converted to a laptop.
|
||||
|
||||
This should only be used in the top-level inputs array.
|
||||
|
||||
The value of this field should be a [Action](#types-Action).
|
||||
|
||||
- `on-converted-to-tablet` (optional):
|
||||
|
||||
An action to execute when the convertible device is converted to a tablet.
|
||||
|
||||
This should only be used in the top-level inputs array.
|
||||
|
||||
The value of this field should be a [Action](#types-Action).
|
||||
|
||||
|
||||
<a name="types-InputMatch"></a>
|
||||
### `InputMatch`
|
||||
|
|
|
|||
|
|
@ -1239,6 +1239,52 @@ Input:
|
|||
match.name = "ZSA Technology Labs Inc ErgoDox EZ"
|
||||
keymap.name = "external"
|
||||
```
|
||||
on-lid-closed:
|
||||
ref: Action
|
||||
required: false
|
||||
description: |
|
||||
An action to execute when the laptop lid is closed.
|
||||
|
||||
This should only be used in the top-level inputs array.
|
||||
|
||||
- Example:
|
||||
|
||||
```toml
|
||||
[[inputs]]
|
||||
match.name = "<switch name>"
|
||||
on-lid-closed = { type = "configure-connector", connector = { match.name = "eDP-1", enabled = false } }
|
||||
on-lid-opened = { type = "configure-connector", connector = { match.name = "eDP-1", enabled = true } }
|
||||
```
|
||||
on-lid-opened:
|
||||
ref: Action
|
||||
required: false
|
||||
description: |
|
||||
An action to execute when the laptop lid is opened.
|
||||
|
||||
This should only be used in the top-level inputs array.
|
||||
|
||||
- Example:
|
||||
|
||||
```toml
|
||||
[[inputs]]
|
||||
match.name = "<switch name>"
|
||||
on-lid-closed = { type = "configure-connector", connector = { match.name = "eDP-1", enabled = false } }
|
||||
on-lid-opened = { type = "configure-connector", connector = { match.name = "eDP-1", enabled = true } }
|
||||
```
|
||||
on-converted-to-laptop:
|
||||
ref: Action
|
||||
required: false
|
||||
description: |
|
||||
An action to execute when the convertible device is converted to a laptop.
|
||||
|
||||
This should only be used in the top-level inputs array.
|
||||
on-converted-to-tablet:
|
||||
ref: Action
|
||||
required: false
|
||||
description: |
|
||||
An action to execute when the convertible device is converted to a tablet.
|
||||
|
||||
This should only be used in the top-level inputs array.
|
||||
|
||||
|
||||
AccelProfile:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue