1
0
Fork 0
forked from wry/wry

toml-config: add input modes

This commit is contained in:
Julian Orth 2025-07-21 15:50:24 +02:00
parent e160aa3406
commit a57f0036a8
10 changed files with 797 additions and 46 deletions

View file

@ -533,6 +533,40 @@
"src",
"dst"
]
},
{
"description": "Pushes an input mode on top of the input-mode stack. The mode can be popped\nwith the `pop-mode` action.\n\n- Example:\n\n ```toml\n [shortcuts]\n alt-x = { type = \"push-mode\", name = \"navigation\" }\n ```\n",
"type": "object",
"properties": {
"type": {
"const": "push-mode"
},
"name": {
"type": "string",
"description": "The name of the mode."
}
},
"required": [
"type",
"name"
]
},
{
"description": "Temporarily pushes an input mode on top of the input-mode stack. The new mode\nwill automatically be popped when the next shortcut is invoked.\n\n- Example:\n\n ```toml\n [shortcuts]\n alt-x = { type = \"latch-mode\", name = \"navigation\" }\n ```\n",
"type": "object",
"properties": {
"type": {
"const": "latch-mode"
},
"name": {
"type": "string",
"description": "The name of the mode."
}
},
"required": [
"type",
"name"
]
}
]
}
@ -949,6 +983,14 @@
"middle-click-paste": {
"type": "boolean",
"description": "Configures whether middle-click pasting is enabled.\n\nChanging this has no effect on running applications.\n\nThe default is `true`.\n"
},
"modes": {
"description": "Configures the input modes.\n\nModes can be used to define shortcuts that are only active when the mode is\nactive.\n\n- Example\n\n ```toml\n [modes.\"navigation\".shortcuts]\n w = \"focus-up\"\n a = \"focus-left\"\n s = \"focus-down\"\n d = \"focus-right\"\n r = \"focus-above\"\n f = \"focus-below\"\n q = \"focus-prev\"\n e = \"focus-next\"\n ```\n\nModes can be activated with the `push-mode` and `latch-mode` actions.\n",
"type": "object",
"additionalProperties": {
"description": "",
"$ref": "#/$defs/InputMode"
}
}
},
"required": []
@ -1420,6 +1462,33 @@
}
]
},
"InputMode": {
"description": "Defines an input mode.\n\nModes can be used to define shortcuts that are only active when the mode is active.\n\n- Example\n\n ```toml\n [modes.\"navigation\".shortcuts]\n w = \"focus-up\"\n a = \"focus-left\"\n s = \"focus-down\"\n d = \"focus-right\"\n r = \"focus-above\"\n f = \"focus-below\"\n q = \"focus-prev\"\n e = \"focus-next\"\n ```\n",
"type": "object",
"properties": {
"parent": {
"type": "string",
"description": "The parent of this input mode.\n\nThis mode inherits all shortcuts from this parent. If this field is not set, then\nit inherits the shortcuts from the top-level shortcuts.\n\nNote that you can disable a shortcut by explicitly assigning it the action `none`.\n"
},
"shortcuts": {
"description": "The shortcuts of this mode.\n\nSee the same field in the top-level `Config` object for a description.\n",
"type": "object",
"additionalProperties": {
"description": "",
"$ref": "#/$defs/Action"
}
},
"complex-shortcuts": {
"description": "The complex shortcuts of this mode.\n\nSee the same field in the top-level `Config` object for a description.\n",
"type": "object",
"additionalProperties": {
"description": "",
"$ref": "#/$defs/ComplexShortcut"
}
}
},
"required": []
},
"Keymap": {
"description": "A keymap.\n",
"anyOf": [
@ -1692,7 +1761,9 @@
"focus-above",
"focus-tiles",
"create-mark",
"jump-to-mark"
"jump-to-mark",
"clear-modes",
"pop-mode"
]
},
"Status": {