SDL_Keymod

Struct SDL_Keymod 

Source
#[repr(transparent)]
pub struct SDL_Keymod(pub Uint16);
Expand description

Valid key modifiers (possibly OR’d together).

§Availability

This datatype is available since SDL 3.2.0.

§Known values (sdl3-sys)

Associated constantGlobal constantDescription
NONESDL_KMOD_NONEno modifier is applicable.
LSHIFTSDL_KMOD_LSHIFTthe left Shift key is down.
RSHIFTSDL_KMOD_RSHIFTthe right Shift key is down.
LEVEL5SDL_KMOD_LEVEL5the Level 5 Shift key is down.
LCTRLSDL_KMOD_LCTRLthe left Ctrl (Control) key is down.
RCTRLSDL_KMOD_RCTRLthe right Ctrl (Control) key is down.
LALTSDL_KMOD_LALTthe left Alt key is down.
RALTSDL_KMOD_RALTthe right Alt key is down.
LGUISDL_KMOD_LGUIthe left GUI key (often the Windows key) is down.
RGUISDL_KMOD_RGUIthe right GUI key (often the Windows key) is down.
NUMSDL_KMOD_NUMthe Num Lock key (may be located on an extended keypad) is down.
CAPSSDL_KMOD_CAPSthe Caps Lock key is down.
MODESDL_KMOD_MODEthe !AltGr key is down.
SCROLLSDL_KMOD_SCROLLthe Scroll Lock key is down.
CTRLSDL_KMOD_CTRLAny Ctrl key is down.
SHIFTSDL_KMOD_SHIFTAny Shift key is down.
ALTSDL_KMOD_ALTAny Alt key is down.
GUISDL_KMOD_GUIAny GUI key is down.

Tuple Fields§

§0: Uint16

Implementations§

Source§

impl SDL_Keymod

Source

pub const NONE: Self

no modifier is applicable.

Source

pub const LSHIFT: Self

the left Shift key is down.

Source

pub const RSHIFT: Self

the right Shift key is down.

Source

pub const LEVEL5: Self

the Level 5 Shift key is down.

Source

pub const LCTRL: Self

the left Ctrl (Control) key is down.

Source

pub const RCTRL: Self

the right Ctrl (Control) key is down.

Source

pub const LALT: Self

the left Alt key is down.

Source

pub const RALT: Self

the right Alt key is down.

Source

pub const LGUI: Self

the left GUI key (often the Windows key) is down.

Source

pub const RGUI: Self

the right GUI key (often the Windows key) is down.

Source

pub const NUM: Self

the Num Lock key (may be located on an extended keypad) is down.

Source

pub const CAPS: Self

the Caps Lock key is down.

Source

pub const MODE: Self

the !AltGr key is down.

Source

pub const SCROLL: Self

the Scroll Lock key is down.

Source

pub const CTRL: Self

Any Ctrl key is down.

Source

pub const SHIFT: Self

Any Shift key is down.

Source

pub const ALT: Self

Any Alt key is down.

Source

pub const GUI: Self

Any GUI key is down.

Trait Implementations§

Source§

impl BitAnd for SDL_Keymod

Source§

type Output = SDL_Keymod

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAndAssign for SDL_Keymod

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitOr for SDL_Keymod

Source§

type Output = SDL_Keymod

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign for SDL_Keymod

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl BitXor for SDL_Keymod

Source§

type Output = SDL_Keymod

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXorAssign for SDL_Keymod

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl Clone for SDL_Keymod

Source§

fn clone(&self) -> SDL_Keymod

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SDL_Keymod

Available on crate feature debug-impls only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SDL_Keymod

Source§

fn default() -> SDL_Keymod

Returns the “default value” for a type. Read more
Source§

impl From<SDL_Keymod> for Uint16

Source§

fn from(value: SDL_Keymod) -> Self

Converts to this type from the input type.
Source§

impl GroupMetadata for SDL_Keymod

Available on crate feature metadata only.
Source§

const GROUP_METADATA: &'static Group

Metadata for this group
Source§

impl Hash for SDL_Keymod

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Not for SDL_Keymod

Source§

type Output = SDL_Keymod

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq<SDL_Keymod> for Uint16

Source§

fn eq(&self, other: &SDL_Keymod) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u16> for SDL_Keymod

Source§

fn eq(&self, other: &Uint16) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for SDL_Keymod

Source§

fn eq(&self, other: &SDL_Keymod) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SDL_Keymod

Source§

impl Eq for SDL_Keymod

Source§

impl StructuralPartialEq for SDL_Keymod

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.