pub struct ButtonChord { /* private fields */ }Expand description
What a controller binding is: one Button, or two pressed together
(a button chord, ticket 1034), written "South+East" in keymap files
and saved bindings. The two are kept in Button::ALL order, so
"East+South" is the same chord as "South+East" (and is shown as the
latter). How a chord fires is the input’s business
(shuyi_ui::input::state).
Implementations§
Source§impl ButtonChord
impl ButtonChord
Sourcepub fn pair(a: Button, b: Button) -> Option<Self>
pub fn pair(a: Button, b: Button) -> Option<Self>
a and b pressed together, in either order; None if they are
the same button.
Sourcepub fn first(self) -> Button
pub fn first(self) -> Button
The button, or a chord’s first button in Button::ALL order.
The button, if this is one button on its own.
The two buttons, in Button::ALL order, if this is a chord.
Trait Implementations§
Source§impl Clone for ButtonChord
impl Clone for ButtonChord
Source§fn clone(&self) -> ButtonChord
fn clone(&self) -> ButtonChord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ButtonChord
Source§impl Debug for ButtonChord
impl Debug for ButtonChord
Source§impl<'de> Deserialize<'de> for ButtonChord
impl<'de> Deserialize<'de> for ButtonChord
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ButtonChord
impl Display for ButtonChord
impl Eq for ButtonChord
Source§impl From<Button> for ButtonChord
impl From<Button> for ButtonChord
Source§impl FromStr for ButtonChord
impl FromStr for ButtonChord
Source§impl Hash for ButtonChord
impl Hash for ButtonChord
Source§impl Ord for ButtonChord
impl Ord for ButtonChord
Source§fn cmp(&self, other: &ButtonChord) -> Ordering
fn cmp(&self, other: &ButtonChord) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ButtonChord
impl PartialEq for ButtonChord
Source§impl PartialEq<Button> for ButtonChord
A binding is a button when it is that button on its own.
impl PartialEq<Button> for ButtonChord
A binding is a button when it is that button on its own.
Source§impl PartialOrd for ButtonChord
impl PartialOrd for ButtonChord
Source§impl Serialize for ButtonChord
impl Serialize for ButtonChord
impl StructuralPartialEq for ButtonChord
Auto Trait Implementations§
impl Freeze for ButtonChord
impl RefUnwindSafe for ButtonChord
impl Send for ButtonChord
impl Sync for ButtonChord
impl Unpin for ButtonChord
impl UnsafeUnpin for ButtonChord
impl UnwindSafe for ButtonChord
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
Mutably borrows from an owned value. Read more