feat(config): show default keybindings in generated example config

- Expand `keybindings` array in `config.example.jsonc` to list all built-in defaults instead of `[]`
- Inject `DEFAULT_KEYBINDINGS` into template when resolved config has an empty keybindings array
- Add regression tests for template parity, default binding compile/action mapping, overlay keyboard dispatch, and mpv plugin registration/dispatch
- Add fullscreen binding to docs shortcut tables and clarify keybindings can target mpv commands or session actions
This commit is contained in:
2026-05-12 22:58:58 -07:00
parent 430373f010
commit c1ee0dfd2e
12 changed files with 665 additions and 40 deletions
+2 -1
View File
@@ -461,7 +461,7 @@ See `config.example.jsonc` for detailed configuration options.
### Keybindings
Add a `keybindings` array to configure keyboard shortcuts that send commands to mpv:
Add a `keybindings` array to configure keyboard shortcuts that send mpv commands or SubMiner session actions:
See `config.example.jsonc` for detailed configuration options and more examples.
@@ -470,6 +470,7 @@ See `config.example.jsonc` for detailed configuration options and more examples.
| Key | Command | Description |
| -------------------- | ----------------------------- | --------------------------------------- |
| `Space` | `["cycle", "pause"]` | Toggle pause |
| `KeyF` | `["cycle", "fullscreen"]` | Toggle fullscreen |
| `KeyJ` | `["cycle", "sid"]` | Cycle primary subtitle track |
| `Shift+KeyJ` | `["cycle", "secondary-sid"]` | Cycle secondary subtitle track |
| `Ctrl+Alt+KeyP` | `["__playlist-browser-open"]` | Open playlist browser |
+121 -2
View File
@@ -183,11 +183,130 @@
// ==========================================
// Keybindings (MPV Commands)
// Extra keybindings that are merged with built-in defaults.
// Default and custom keybindings that are merged with built-in defaults.
// Set command to null to disable a default keybinding.
// Hot-reload: keybinding changes apply live and update the session help modal on reopen.
// ==========================================
"keybindings": [], // Extra keybindings that are merged with built-in defaults.
"keybindings": [
{
"key": "Space", // Key setting.
"command": [
"cycle",
"pause"
] // Command setting.
},
{
"key": "KeyF", // Key setting.
"command": [
"cycle",
"fullscreen"
] // Command setting.
},
{
"key": "KeyJ", // Key setting.
"command": [
"cycle",
"sid"
] // Command setting.
},
{
"key": "Shift+KeyJ", // Key setting.
"command": [
"cycle",
"secondary-sid"
] // Command setting.
},
{
"key": "ArrowRight", // Key setting.
"command": [
"seek",
5
] // Command setting.
},
{
"key": "ArrowLeft", // Key setting.
"command": [
"seek",
-5
] // Command setting.
},
{
"key": "ArrowUp", // Key setting.
"command": [
"seek",
60
] // Command setting.
},
{
"key": "ArrowDown", // Key setting.
"command": [
"seek",
-60
] // Command setting.
},
{
"key": "Shift+KeyH", // Key setting.
"command": [
"sub-seek",
-1
] // Command setting.
},
{
"key": "Shift+KeyL", // Key setting.
"command": [
"sub-seek",
1
] // Command setting.
},
{
"key": "Shift+BracketRight", // Key setting.
"command": [
"__sub-delay-next-line"
] // Command setting.
},
{
"key": "Shift+BracketLeft", // Key setting.
"command": [
"__sub-delay-prev-line"
] // Command setting.
},
{
"key": "Ctrl+Alt+KeyC", // Key setting.
"command": [
"__youtube-picker-open"
] // Command setting.
},
{
"key": "Ctrl+Alt+KeyP", // Key setting.
"command": [
"__playlist-browser-open"
] // Command setting.
},
{
"key": "Ctrl+Shift+KeyH", // Key setting.
"command": [
"__replay-subtitle"
] // Command setting.
},
{
"key": "Ctrl+Shift+KeyL", // Key setting.
"command": [
"__play-next-subtitle"
] // Command setting.
},
{
"key": "KeyQ", // Key setting.
"command": [
"quit"
] // Command setting.
},
{
"key": "Ctrl+KeyW", // Key setting.
"command": [
"quit"
] // Command setting.
}
], // Default and custom keybindings that are merged with built-in defaults.
// ==========================================
// Secondary Subtitles
+1
View File
@@ -38,6 +38,7 @@ These control playback and subtitle display. They require overlay window focus.
| Shortcut | Action |
| -------------------- | --------------------------------------------------- |
| `Space` | Toggle mpv pause |
| `F` | Toggle fullscreen |
| `V` | Toggle primary subtitle bar visibility |
| `J` | Cycle primary subtitle track |
| `Shift+J` | Cycle secondary subtitle track |