Enum PhysicalKey
pub enum PhysicalKey {
Code(KeyCode),
Unidentified(NativeKeyCode),
}
Expand description
Represents the location of a physical key.
This type is a superset of KeyCode
, including an Unidentified
variant.
Variants§
Code(KeyCode)
A known key code
Unidentified(NativeKeyCode)
This variant is used when the key cannot be translated to a KeyCode
The native keycode is provided (if available) so you’re able to more reliably match
key-press and key-release events by hashing the PhysicalKey
. It is also possible to use
this for keybinds for non-standard keys, but such keybinds are tied to a given platform.
Trait Implementations§
§impl Clone for PhysicalKey
impl Clone for PhysicalKey
§fn clone(&self) -> PhysicalKey
fn clone(&self) -> PhysicalKey
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for PhysicalKey
impl Debug for PhysicalKey
§impl From<KeyCode> for PhysicalKey
impl From<KeyCode> for PhysicalKey
§fn from(code: KeyCode) -> PhysicalKey
fn from(code: KeyCode) -> PhysicalKey
Converts to this type from the input type.
§impl From<NativeKeyCode> for PhysicalKey
impl From<NativeKeyCode> for PhysicalKey
§fn from(code: NativeKeyCode) -> PhysicalKey
fn from(code: NativeKeyCode) -> PhysicalKey
Converts to this type from the input type.
§impl Hash for PhysicalKey
impl Hash for PhysicalKey
§impl Ord for PhysicalKey
impl Ord for PhysicalKey
§impl PartialEq<KeyCode> for PhysicalKey
impl PartialEq<KeyCode> for PhysicalKey
§impl PartialEq<NativeKeyCode> for PhysicalKey
impl PartialEq<NativeKeyCode> for PhysicalKey
§impl PartialEq<PhysicalKey> for KeyCode
impl PartialEq<PhysicalKey> for KeyCode
§impl PartialEq<PhysicalKey> for NativeKeyCode
impl PartialEq<PhysicalKey> for NativeKeyCode
§impl PartialEq for PhysicalKey
impl PartialEq for PhysicalKey
§impl PartialOrd for PhysicalKey
impl PartialOrd for PhysicalKey
§impl PhysicalKeyExtScancode for PhysicalKey
impl PhysicalKeyExtScancode for PhysicalKey
§fn to_scancode(self) -> Option<u32>
fn to_scancode(self) -> Option<u32>
The raw value of the platform-specific physical key identifier. Read more
§fn from_scancode(scancode: u32) -> PhysicalKey
fn from_scancode(scancode: u32) -> PhysicalKey
Constructs a
PhysicalKey
from a platform-specific physical key identifier. Read moreimpl Copy for PhysicalKey
impl Eq for PhysicalKey
impl StructuralPartialEq for PhysicalKey
Auto Trait Implementations§
impl Freeze for PhysicalKey
impl RefUnwindSafe for PhysicalKey
impl Send for PhysicalKey
impl Sync for PhysicalKey
impl Unpin for PhysicalKey
impl UnwindSafe for PhysicalKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.