Shell 11: fluxer-core keybinds: actions, combos, matcher, holds #803

Closed
opened 2026-11-17 23:02:48 +00:00 by charles · 0 comments
Owner

Task 11 of the Desktop shell plan (docs/superpowers/plans/2026-11-17-desktop-shell.md, section "### Task 11:"). The plan on the shell branch is the source of truth; this copy is for reading.

Closes: — Depends on: 6

Files:

  • Create: crates/fluxer-core/src/shell/keybinds.rs · Modify: shell/mod.rs, crates/fluxer-core/src/voice/{transmit.rs,settings.rs}, README · Test: crates/fluxer-core/tests/shell_keybinds.rs

Interfaces:

  • Produces: ShortcutAction (spec §8.1; ALL, id() = the original's ids, label(), kind() -> Press | Hold, global_capable(), default_combos()), KeyCombo { code, key, ctrl, alt, shift, meta, mouse_button, modifier_only, both_sides, global }, Keybinds { custom: map action → Vec<KeyCombo> } with stored / apply_stored, effective(action).

  • The matcher as D/GlobalShortcutMatcher.ts: Matcher::feed(&ShortcutInput) -> Vec<ShortcutEvent> (modifier rule, layout key, modifier-only and both sides committed on release, release keyed on the pressing key, reset() releasing everything). armed(app) -> set (holds per transmit mode, feat/app/keybindings/utils/RuntimeKeybinds.ts:29-36). conflicts(&Keybinds) -> Vec<(action, action)> (combosLooseEqual).

  • Hold sources (feat/input/state/HoldSources.ts): voice::transmit takes HoldSource::{Window, Global} presses for PushToTalk and PushToMute; the release delay applies when the last push-to-talk source lets go; PushToMute → targetMute = held || self_mute. UserAction::PttKey stays as the window source. VoiceSettings::ptt_key reads and writes the first custom PushToTalk combo.

  • ShortcutEvent { action, pressed } → ToggleSelfMute, ToggleSelfDeaf, LeaveVoice, the transmit-mode toggle, the holds; ShellEvent::Session(Locked | Suspending) and Backend(Stopped) release everything.

  • KeybindAction::{Record(action), Captured(KeyCombo), Clear(action, index), SetGlobal(action, index, bool), ResetDefaults(action), CancelRecord}.

  • Step 1: failing tests: actions_have_original_ids_and_defaults, table matcher_cases (bare key with modifiers held, exact modifiers, layout key, numpad, mouse buttons, modifier-only, both sides, release after modifier change), only_mode_holds_armed, ptt_release_delay_only_on_last_source, push_to_mute_ors_with_self_mute, conflicts_found, ptt_key_setting_is_first_combo, lock_and_backend_stop_release_all, proptest any_input_sequence_then_reset_leaves_nothing_held, combo_debug_prints_no_key.

  • Step 2–5: FAIL → implement → PASS → commit feat(core): keybind model and matcher.

Task 11 of the Desktop shell plan (`docs/superpowers/plans/2026-11-17-desktop-shell.md`, section "### Task 11:"). The plan on the `shell` branch is the source of truth; this copy is for reading. **Closes:** — **Depends on:** 6 **Files:** - Create: `crates/fluxer-core/src/shell/keybinds.rs` · Modify: `shell/mod.rs`, `crates/fluxer-core/src/voice/{transmit.rs,settings.rs}`, README · Test: `crates/fluxer-core/tests/shell_keybinds.rs` **Interfaces:** - Produces: `ShortcutAction` (spec §8.1; `ALL`, `id()` = the original's ids, `label()`, `kind() -> Press | Hold`, `global_capable()`, `default_combos()`), `KeyCombo { code, key, ctrl, alt, shift, meta, mouse_button, modifier_only, both_sides, global }`, `Keybinds { custom: map action → Vec<KeyCombo> }` with `stored` / `apply_stored`, `effective(action)`. - The matcher as `D/GlobalShortcutMatcher.ts`: `Matcher::feed(&ShortcutInput) -> Vec<ShortcutEvent>` (modifier rule, layout key, modifier-only and both sides committed on release, release keyed on the pressing key, `reset()` releasing everything). `armed(app) -> set` (holds per transmit mode, `feat/app/keybindings/utils/RuntimeKeybinds.ts:29-36`). `conflicts(&Keybinds) -> Vec<(action, action)>` (`combosLooseEqual`). - Hold sources (`feat/input/state/HoldSources.ts`): `voice::transmit` takes `HoldSource::{Window, Global}` presses for `PushToTalk` and `PushToMute`; the release delay applies when the last push-to-talk source lets go; `PushToMute` → `targetMute = held || self_mute`. `UserAction::PttKey` stays as the window source. `VoiceSettings::ptt_key` reads and writes the first custom `PushToTalk` combo. - `ShortcutEvent { action, pressed }` → `ToggleSelfMute`, `ToggleSelfDeaf`, `LeaveVoice`, the transmit-mode toggle, the holds; `ShellEvent::Session(Locked | Suspending)` and `Backend(Stopped)` release everything. - `KeybindAction::{Record(action), Captured(KeyCombo), Clear(action, index), SetGlobal(action, index, bool), ResetDefaults(action), CancelRecord}`. - [ ] **Step 1: failing tests**: `actions_have_original_ids_and_defaults`, table `matcher_cases` (bare key with modifiers held, exact modifiers, layout key, numpad, mouse buttons, modifier-only, both sides, release after modifier change), `only_mode_holds_armed`, `ptt_release_delay_only_on_last_source`, `push_to_mute_ors_with_self_mute`, `conflicts_found`, `ptt_key_setting_is_first_combo`, `lock_and_backend_stop_release_all`, proptest `any_input_sequence_then_reset_leaves_nothing_held`, `combo_debug_prints_no_key`. - [ ] **Step 2–5:** FAIL → implement → PASS → commit `feat(core): keybind model and matcher`.
charles added this to the Desktop shell milestone 2026-11-17 23:02:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#803
No description provided.