#[non_exhaustive]#[repr(u8)]pub enum KeyMedia {
Show 29 variants
Play = 0,
Pause = 1,
PlayPause = 2,
Reverse = 3,
Stop = 4,
FastForward = 5,
Rewind = 6,
Next = 7,
Previous = 8,
Record = 9,
LowerVolume = 10,
RaiseVolume = 11,
MuteVolume = 12,
Eject = 13,
MediaSelect = 14,
LaunchMedia = 15,
BassBoost = 16,
BassUp = 17,
BassDown = 18,
TrebleUp = 19,
TrebleDown = 20,
MicrophoneMute = 21,
MicrophoneVolumeUp = 22,
MicrophoneVolumeDown = 23,
BrightnessUp = 24,
BrightnessDown = 25,
Sleep = 26,
Wake = 27,
Power = 28,
}event only.Expand description
๐ฎ Media key codes.
๐ ui/event
๐ฆ size_of::<KeyMedia>() == 1 bytes / 8 bits
โ๏ธOption<T>
These keys are commonly found on multimedia keyboards and remote controls.
Variants (Non-exhaustive)ยง
This enum is marked as non-exhaustive
Play = 0
Starts media playback.
Pause = 1
Pauses media playback.
PlayPause = 2
Toggles between playing and pausing media.
Reverse = 3
Plays media in reverse.
Stop = 4
Stops media playback.
FastForward = 5
Fast-forwards through media.
Rewind = 6
Rewinds through media.
Next = 7
Skips to the next media track.
Previous = 8
Returns to the previous media track.
Record = 9
Starts recording media.
LowerVolume = 10
Decreases the audio volume.
RaiseVolume = 11
Increases the audio volume.
MuteVolume = 12
Mutes or unmutes the audio.
Eject = 13
Ejects a removable media disk (found on some keyboards, especially Macs).
MediaSelect = 14
Opens the default media player application.
LaunchMedia = 15
Launches a media-related application.
BassBoost = 16
Toggles bass boost mode.
BassUp = 17
Increases bass levels.
BassDown = 18
Decreases bass levels.
TrebleUp = 19
Increases treble levels.
TrebleDown = 20
Decreases treble levels.
MicrophoneMute = 21
Mutes or unmutes the microphone.
MicrophoneVolumeUp = 22
Increases the microphone input volume.
MicrophoneVolumeDown = 23
Decreases the microphone input volume.
BrightnessUp = 24
Increases the screen brightness.
BrightnessDown = 25
Decreases the screen brightness.
Sleep = 26
Puts the system into sleep mode.
Wake = 27
Wakes the system from sleep mode.
Power = 28
Powers the system off or performs a power-related action.
Implementationsยง
Sourceยงimpl KeyMedia
impl KeyMedia
Sourcepub const fn from_web_code(code: &str) -> Option<Self> โ
Available on crate feature web only.
pub const fn from_web_code(code: &str) -> Option<Self> โ
web only.Atempts to construct a KeyMedia from a JavaScript KeyboardEvent physical code.
Sourcepub const fn to_web_code(self) -> &'static str โ
Available on crate feature web only.
pub const fn to_web_code(self) -> &'static str โ
web only.Returns a JavaScript KeyboardEvent physical code.
Sourcepub const fn from_web_key(key: &str) -> Option<Self> โ
Available on crate feature web only.
pub const fn from_web_key(key: &str) -> Option<Self> โ
web only.Atempts to construct a KeyMedia from a JavaScript KeyboardEvent semantic key.
Sourcepub const fn to_web_key(self) -> &'static str โ
Available on crate feature web only.
pub const fn to_web_key(self) -> &'static str โ
web only.Returns a JavaScript KeyboardEvent semantic key.
Trait Implementationsยง
impl Copy for KeyMedia
impl Eq for KeyMedia
Sourceยงimpl PartialEq for KeyMedia
impl PartialEq for KeyMedia
impl StructuralPartialEq for KeyMedia
Auto Trait Implementationsยง
impl Freeze for KeyMedia
impl RefUnwindSafe for KeyMedia
impl Send for KeyMedia
impl Sync for KeyMedia
impl Unpin for KeyMedia
impl UnsafeUnpin for KeyMedia
impl UnwindSafe for KeyMedia
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.