RKTK API Docs RKTK Home Repo

rktk_keymanager/keycode/
media.rs

1//! Media keys.
2
3use macro_rules_attribute::apply;
4
5use crate::macros::{common_derive, impl_display, normal, with_consts};
6
7/// Represents `media key` which is used for media control.
8///
9/// These keys are sent using a different descriptor than normal keys.
10#[apply(with_consts)]
11#[apply(common_derive)]
12#[derive(Copy, strum::EnumIter, strum::IntoStaticStr)]
13pub enum Media {
14    Zero = 0x00,
15    Play = 0xB0,
16    MPause = 0xB1,
17    Record = 0xB2,
18    NextTrack = 0xB5,
19    PrevTrack = 0xB6,
20    MStop = 0xB7,
21    RandomPlay = 0xB9,
22    Repeat = 0xBC,
23    PlayPause = 0xCD,
24    MMute = 0xE2,
25    VolumeIncrement = 0xE9,
26    VolumeDecrement = 0xEA,
27    Reserved = 0xEB,
28}
29
30impl_display!(Media);
31
32normal!(VOLUP, Media, VolumeIncrement);
33normal!(VOLDN, Media, VolumeDecrement);