pub struct ButtonTiming {
pub long_press_ms: u64,
pub multi_tap_ms: u64,
}Expand description
Press-decoding timing shared by both front-panel drivers — the Fire27
physical buttons (ButtonResources::into_buttons_with_timing, feature
buttons) and the CoreS3 touch strip
(TouchButtonsConfig::with_timing).
Milliseconds (the touch driver’s native unit; the Fire27 async-button
Durations are built from these).
The knob that matters for latency is multi_tap_ms: both drivers count
consecutive taps, which delays every single press by that window. Set it to
0 (see immediate_single_press) for
latency-sensitive input like an encoder — a downstream accumulator can still
sum immediate Short(1) events into multi-step (#58).
Fields§
§long_press_ms: u64Hold time before a press becomes ButtonAction::Long.
multi_tap_ms: u64Max gap between consecutive taps still counted as one multi-tap sequence.
0 disables counting: each press emits Short(1)
as soon as it is debounced, with no counting delay.
Implementations§
Source§impl ButtonTiming
impl ButtonTiming
Sourcepub const fn multi_tap() -> Self
pub const fn multi_tap() -> Self
Count multi-taps (the historical behaviour): a single press is delayed by
the multi_tap_ms window so consecutive taps can be counted. 500 ms
long-press, 300 ms multi-tap window.
Sourcepub const fn immediate_single_press() -> Self
pub const fn immediate_single_press() -> Self
Report every press immediately — multi-tap counting disabled
(multi_tap_ms = 0). For latency-sensitive input (e.g. an encoder). Keeps
the multi_tap long-press threshold.
Trait Implementations§
Source§impl Clone for ButtonTiming
impl Clone for ButtonTiming
Source§fn clone(&self) -> ButtonTiming
fn clone(&self) -> ButtonTiming
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ButtonTiming
impl Debug for ButtonTiming
Source§impl Default for ButtonTiming
The unified opt-in baseline is multi_tap. Note the legacy
entry points (ButtonResources::into_buttons,
TouchButtons::new with
TouchButtonsConfig::default)
keep each driver’s original per-board timings for backward compatibility;
this default is only used where a ButtonTiming is taken explicitly.
impl Default for ButtonTiming
The unified opt-in baseline is multi_tap. Note the legacy
entry points (ButtonResources::into_buttons,
TouchButtons::new with
TouchButtonsConfig::default)
keep each driver’s original per-board timings for backward compatibility;
this default is only used where a ButtonTiming is taken explicitly.
Source§impl PartialEq for ButtonTiming
impl PartialEq for ButtonTiming
impl Copy for ButtonTiming
impl Eq for ButtonTiming
impl StructuralPartialEq for ButtonTiming
Auto Trait Implementations§
impl Freeze for ButtonTiming
impl PsramSafe for ButtonTiming
impl RefUnwindSafe for ButtonTiming
impl Send for ButtonTiming
impl Sync for ButtonTiming
impl Unpin for ButtonTiming
impl UnsafeUnpin for ButtonTiming
impl UnwindSafe for ButtonTiming
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)