#[non_exhaustive]pub enum Event {
#[non_exhaustive] Button {
button: Button,
pressed: bool,
at: Stamp,
},
#[non_exhaustive] Key {
key: Key,
pressed: bool,
at: Stamp,
},
#[non_exhaustive] Media {
key: MediaKey,
pressed: bool,
at: Stamp,
},
#[non_exhaustive] Motion {
dx: i32,
dy: i32,
wheel: i32,
pan: i32,
at: Stamp,
},
#[non_exhaustive] Dropped {
count: u64,
source: DropSource,
},
SessionReset,
#[non_exhaustive] Rejected {
action: Action,
count: u64,
},
Disconnected,
Reconnected,
Changed,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]Button
a physical button
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Key
a physical key on the keyboard behind the box. just know that you see every key typed there, passwords included
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Media
a physical media key, like volume or play
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Motion
physical motion. the wheel is positive going up and pan (horizontal scroll) is positive going right
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Dropped
how many events never reached you since the last Dropped from the same source. one from the box can mean
it restarted a stream, so what you knew about which physical buttons and keys were held may be out of date.
the one for your own queue (DropSource::Host) sits at the front of the queue, not where the loss happened,
and on Medius the one from the box comes from a box wide counter read about once a second, so it can also
count what your own subscriptions through medius() lost
Fields
This variant is marked as non-exhaustive
source: DropSourceSessionReset
the box lost its state, so the buttons and keys you were holding got released (on a box with
Quirk::KeepsHeld they stay held). what you knew about which physical buttons and keys were held is out of
date too, because one held through the reset can show a second press or never show its release
#[non_exhaustive]Rejected
the box refused something after the call already returned ok, MAKCU does that when its command queue is
full. slow down and send it again if it mattered. count is how many of that action got refused since you
last read one, so a flood of refusals never pushes your input out of the queue
Fields
This variant is marked as non-exhaustive
Disconnected
Reconnected
the box is back, the buttons and keys you were holding got released (on a box with Quirk::KeepsHeld
they stay held), and the snapshot may have changed. on a MAKCU you also get this when a mouse or keyboard
gets plugged into the box or pulled out, and on a Medius when the device it clones gets swapped. what you
knew about which physical buttons and keys were held is out of date, same as after SessionReset
Changed
the snapshot changed with no reconnect, so read snapshot() again. a mouse or keyboard set or pulled on a
Ferrum, a YSC turning its keys off, or a Medius clone whose details changed come this way. so does a Ferrum
unplugged from this PC, because the app’s port stays open and the app just loses its devices, and once it’s
back you get a SessionReset after this one, since the box forgot its locks. a MAKCU gets a Reconnected
for those instead, so watch both. two of these never wait unread in the same receiver
Implementations§
Source§impl Event
for tests and for code that builds events itself. the variants stay #[non_exhaustive] so a field added
later doesn’t break anyone, and these are how you make them from outside
impl Event
for tests and for code that builds events itself. the variants stay #[non_exhaustive] so a field added
later doesn’t break anyone, and these are how you make them from outside