[][src]Struct sixtyfps_corelib::input::KeyboardModifiers

#[repr(C)]pub struct KeyboardModifiers(_);

KeyboardModifiers wraps a u32 that reserves a single bit for each possible modifier key on a keyboard, such as Shift, Control, etc.

On macOS, the command key is mapped to the logo modifier.

On Windows, the windows key is mapped to the logo modifier.

Implementations

impl KeyboardModifiers[src]

pub fn test(&self, modifier: KeyboardModifier) -> bool[src]

Returns true if this set of keyboard modifiers includes the given modifier; false otherwise.

Arguments:

  • modifier: The keyboard modifier to test for, usually one of the provided convenience constants such as SHIFT_MODIFIER.

pub fn test_exclusive(&self, modifier: KeyboardModifier) -> bool[src]

Returns true if this set of keyboard modifiers consists of exactly the one specified modifier; false otherwise.

Arguments:

  • modifier: The only modifier that is allowed to be in this modifier set, in order

pub fn shift(&self) -> bool[src]

Returns true if the shift key is part of this set of keyboard modifiers.

pub fn control(&self) -> bool[src]

Returns true if the control key is part of this set of keyboard modifiers.

pub fn alt(&self) -> bool[src]

Returns true if the alt key is part of this set of keyboard modifiers.

Returns true if on macOS the command key and on Windows the Windows key is part of this set of keyboard modifiers.

Trait Implementations

impl Clone for KeyboardModifiers[src]

impl Copy for KeyboardModifiers[src]

impl Debug for KeyboardModifiers[src]

impl Default for KeyboardModifiers[src]

impl Eq for KeyboardModifiers[src]

impl From<KeyboardModifier> for KeyboardModifiers[src]

impl From<ModifiersState> for KeyboardModifiers[src]

impl PartialEq<KeyboardModifiers> for KeyboardModifiers[src]

impl StructuralEq for KeyboardModifiers[src]

impl StructuralPartialEq for KeyboardModifiers[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.