pub enum RawInputEvent {
Down(Chord),
Up(Key),
Text(char),
PadDown(Button, PadKind),
PadUp(Button),
}Expand description
A keyboard or controller event as the platform reports it.
Variants§
Down(Chord)
A key went down, with the Shift state at the time.
Up(Key)
A key went up.
Text(char)
A character was typed (the platform’s text input: the keyboard’s own
layout and Shift applied), for text boxes such as a name. Comes with
the key’s own Down.
PadDown(Button, PadKind)
A controller button went down on a pad of this kind (its binding
position, from Pads::update).
PadUp(Button)
A controller button went up on every pad.
Implementations§
Source§impl RawInputEvent
impl RawInputEvent
Sourcepub fn from_pads(
pads: &mut Pads,
connected: &[(PadId, PadKind, PadState)],
) -> Vec<Self>
pub fn from_pads( pads: &mut Pads, connected: &[(PadId, PadKind, PadState)], ) -> Vec<Self>
This frame’s controller events: what Pads::update reports for
the pads connected now, releases first, each press with the kind
of the pad that pressed it.
Sourcepub fn from_crank(
crank: &mut Crank,
degrees: f32,
docked: bool,
kind: PadKind,
) -> Vec<Self>
pub fn from_crank( crank: &mut Crank, degrees: f32, docked: bool, kind: PadKind, ) -> Vec<Self>
This frame’s crank events: the crank turned degrees since the
last frame (forwards positive), on a pad of kind; docked if it
is folded away (then nothing, and a part notch is forgotten). Each
notch is a press and a release of Button::CrankBack or
Button::CrankForward (Crank).
Sourcepub fn from_crank_steps(
crank: &mut Crank,
steps: i32,
docked: bool,
kind: PadKind,
) -> Vec<Self>
pub fn from_crank_steps( crank: &mut Crank, steps: i32, docked: bool, kind: PadKind, ) -> Vec<Self>
from_crank of a turn in whole steps
(Crank::turn_steps): what a backend that reads a float hands on
from its boundary.
Trait Implementations§
Source§impl Clone for RawInputEvent
impl Clone for RawInputEvent
Source§fn clone(&self) -> RawInputEvent
fn clone(&self) -> RawInputEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more