pub struct PaneKeyboardController { /* private fields */ }Expand description
A reusable terminal pane keyboard host: translates keys to commands,
resolves them against a live tree, applies structural operations, and tracks
focus + maximize state. Hosts own the PaneTree; this owns the focus state
and a monotonic operation counter.
Implementations§
Source§impl PaneKeyboardController
impl PaneKeyboardController
Sourcepub fn new(active: Option<PaneId>) -> Self
pub fn new(active: Option<PaneId>) -> Self
Create a controller focused on active (or unfocused if None).
Sourcepub fn take_announcement(&mut self) -> Option<PaneAnnouncement>
pub fn take_announcement(&mut self) -> Option<PaneAnnouncement>
Take the pending accessibility announcement (for a status line / screen reader), coalesced and de-duplicated. Call once per render.
Sourcepub fn pending_announcement(&self) -> Option<&PaneAnnouncement>
pub fn pending_announcement(&self) -> Option<&PaneAnnouncement>
Peek the pending accessibility announcement without consuming it.
Sourcepub const fn with_acceleration(
self,
acceleration: PaneCommandAcceleration,
) -> Self
pub const fn with_acceleration( self, acceleration: PaneCommandAcceleration, ) -> Self
Override the resize acceleration policy.
Sourcepub const fn with_preferences(
self,
preferences: PaneAccessibilityPreferences,
) -> Self
pub const fn with_preferences( self, preferences: PaneAccessibilityPreferences, ) -> Self
Set the accessibility preferences (reduced-motion / high-contrast / large-target) at construction time (bd-21pbi.5).
Sourcepub const fn set_preferences(
&mut self,
preferences: PaneAccessibilityPreferences,
)
pub const fn set_preferences( &mut self, preferences: PaneAccessibilityPreferences, )
Update the accessibility preferences at runtime (e.g. when the user toggles a mode). Never affects focus/command semantics — only the presentation helpers below.
Sourcepub const fn preferences(&self) -> PaneAccessibilityPreferences
pub const fn preferences(&self) -> PaneAccessibilityPreferences
The active accessibility preferences.
Sourcepub fn affordance_motion(&self) -> PaneAffordanceMotion
pub fn affordance_motion(&self) -> PaneAffordanceMotion
The affordance micro-animation policy implied by the current preferences (motion is stepped under reduced-motion).
Sourcepub fn focus_ring(&self, theme: &ResolvedTheme) -> PaneFocusRing
pub fn focus_ring(&self, theme: &ResolvedTheme) -> PaneFocusRing
Build a focus ring for the active pane from theme, honoring the
high-contrast preference. The ring color is contrast-clamped against the
pane surface (AAA when high-contrast is on, AA otherwise).
Sourcepub const fn focus(&self) -> PaneFocusContext
pub const fn focus(&self) -> PaneFocusContext
The current focus context (active + maximized pane).
Sourcepub const fn set_active(&mut self, active: Option<PaneId>)
pub const fn set_active(&mut self, active: Option<PaneId>)
Set the active pane (e.g. when a pointer click changes focus).
Sourcepub fn handle_key(
&mut self,
key: &KeyEvent,
tree: &mut PaneTree,
layout: &PaneLayout,
) -> PaneKeyOutcome
pub fn handle_key( &mut self, key: &KeyEvent, tree: &mut PaneTree, layout: &PaneLayout, ) -> PaneKeyOutcome
Translate, resolve, and apply one key event. Structural commands mutate
tree; focus/maximize commands update internal state. The layout must
be the solved layout of tree (used for spatial focus + move).
Trait Implementations§
Source§impl Clone for PaneKeyboardController
impl Clone for PaneKeyboardController
Source§fn clone(&self) -> PaneKeyboardController
fn clone(&self) -> PaneKeyboardController
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more