pub struct ButtonPress {
pub pin: u32,
pub label: Option<String>,
pub kind: String,
pub action: Option<String>,
pub timestamp_ms: u64,
}Expand description
One decoded front-panel press.
pin is the board GPIO line (BCM on a Raspberry Pi, the Linux GPIO number
elsewhere); label is the front-panel button (B1..B4, the key the button
mapping uses), which stays the same across boards, so a subscriber that
means “the first panel button” matches on the label. action is the host’s
live mapping for that (button, kind) pair and is None for an unmapped
button — a subscriber sees the press either way and decides for itself
whether an unmapped button means anything.
A board with a rotary encoder delivers it through the same event: one detent
is a short press labelled ENC_CW or ENC_CCW (pin is the encoder’s A
line), and its push switch is a short/long press labelled ENC_SW.
Fields§
§pin: u32Board GPIO line of the button.
label: Option<String>Front-panel button label (B1..B4, BX<pin> for an extra button,
ENC_CW / ENC_CCW / ENC_SW for the rotary encoder); None from a
host that predates the field.
kind: String"short" or "long", decoded by the host on the release edge.
action: Option<String>Resolved action name from the live mapping; None when unmapped.
timestamp_ms: u64Release-edge timestamp, monotonic milliseconds since the reader started.
Implementations§
Trait Implementations§
Source§impl Clone for ButtonPress
impl Clone for ButtonPress
Source§impl Debug for ButtonPress
impl Debug for ButtonPress
Source§impl<'de> Deserialize<'de> for ButtonPress
impl<'de> Deserialize<'de> for ButtonPress
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ButtonPress
Source§impl PartialEq for ButtonPress
impl PartialEq for ButtonPress
Source§impl Serialize for ButtonPress
impl Serialize for ButtonPress
impl StructuralPartialEq for ButtonPress
Auto Trait Implementations§
impl Freeze for ButtonPress
impl RefUnwindSafe for ButtonPress
impl Send for ButtonPress
impl Sync for ButtonPress
impl Unpin for ButtonPress
impl UnsafeUnpin for ButtonPress
impl UnwindSafe for ButtonPress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.