Skip to content

Commit 9219d32

Browse files
committed
Supporting media keys (wayland + Windows) for now.
1 parent c77b4e5 commit 9219d32

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

src/linux/wayland/keycodes.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,15 @@ decl_keycodes!(
153153
Kp7, 71,
154154
Kp8, 72,
155155
Kp9, 73,
156-
KpDelete, 83
156+
KpDelete, 83,
157+
VolumeMute, 113,
158+
VolumeDown, 114,
159+
VolumeUp, 115,
160+
NextTrack, 163,
161+
PlayPause, 164,
162+
PreviousTrack, 165,
163+
PlayCd, 200,
164+
Function, 464
157165
);
158166

159167
#[rustfmt::skip]
@@ -259,7 +267,14 @@ decl_keycodes_uinput!(
259267
Key::Delete , UKey::Delete,
260268
Key::Pause , UKey::Pause,
261269
Key::MetaLeft , UKey::LeftMeta,
262-
Key::PrintScreen , UKey::Print
270+
Key::PrintScreen , UKey::Print,
271+
Key::PlayPause, UKey::PlayPause,
272+
Key::PlayCd, UKey::PlayCD,
273+
Key::VolumeMute, UKey::Mute,
274+
Key::VolumeDown, UKey::VolumeDown,
275+
Key::VolumeUp, UKey::VolumeUp,
276+
Key::NextTrack, UKey::NextSong,
277+
Key::PreviousTrack, UKey::PreviousSong
263278
//Key::IntlBackslash , UKey::Backslash
264279
);
265280

src/rdev.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,15 @@ pub enum Key {
220220
Kp9,
221221
KpDelete,
222222
Function,
223+
VolumeUp,
224+
VolumeDown,
225+
VolumeMute,
226+
BrightnessUp,
227+
BrightnessDown,
228+
PreviousTrack,
229+
PlayPause,
230+
PlayCd,
231+
NextTrack,
223232
Unknown(u32),
224233
}
225234

src/windows/keycodes.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,13 @@ decl_keycodes! {
145145
Kp7, 103,
146146
Kp8, 104,
147147
Kp9, 105,
148-
KpDelete, 110
148+
KpDelete, 110,
149+
VolumeMute, 173,
150+
VolumeDown, 174,
151+
VolumeUp, 175,
152+
NextTrack, 176,
153+
PreviousTrack, 177,
154+
PlayPause, 179
149155
}
150156

151157
#[cfg(test)]

0 commit comments

Comments
 (0)