这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/linux/wayland/grab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,7 @@ fn setup_inotify(epoll_fd: RawFd, devices: &[Device]) -> io::Result<Inotify> {
//Ensure there is space for inotify at last epoll index.
if devices.len() as u64 >= INOTIFY_DATA {
eprintln!("number of devices: {}", devices.len());
return Err(io::Error::new(
io::ErrorKind::Other,
"too many device files!",
));
return Err(io::Error::other("too many device files!"));
}
// Set up inotify to listen for new devices being plugged in
let inotify = inotify_devices()?;
Expand Down
19 changes: 17 additions & 2 deletions src/linux/wayland/keycodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,15 @@ decl_keycodes!(
Kp7, 71,
Kp8, 72,
Kp9, 73,
KpDelete, 83
KpDelete, 83,
VolumeMute, 113,
VolumeDown, 114,
VolumeUp, 115,
NextTrack, 163,
PlayPause, 164,
PreviousTrack, 165,
PlayCd, 200,
Function, 464
);

#[rustfmt::skip]
Expand Down Expand Up @@ -259,7 +267,14 @@ decl_keycodes_uinput!(
Key::Delete , UKey::Delete,
Key::Pause , UKey::Pause,
Key::MetaLeft , UKey::LeftMeta,
Key::PrintScreen , UKey::Print
Key::PrintScreen , UKey::Print,
Key::PlayPause, UKey::PlayPause,
Key::PlayCd, UKey::PlayCD,
Key::VolumeMute, UKey::Mute,
Key::VolumeDown, UKey::VolumeDown,
Key::VolumeUp, UKey::VolumeUp,
Key::NextTrack, UKey::NextSong,
Key::PreviousTrack, UKey::PreviousSong
//Key::IntlBackslash , UKey::Backslash
);

Expand Down
1 change: 1 addition & 0 deletions src/linux/wayland/listen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ fn convert(keyboard: &mut Keyboard, libevent: LibEvent) -> Option<Event> {

impl LibinputInterface for Interface {
fn open_restricted(&mut self, path: &Path, flags: i32) -> Result<OwnedFd, i32> {
#[allow(clippy::bad_bit_mask)]
OpenOptions::new()
.custom_flags(flags)
.read((flags & O_RDONLY != 0) | (flags & O_RDWR != 0))
Expand Down
2 changes: 1 addition & 1 deletion src/linux/wayland/xkb_keycodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ use std::os::raw::c_uint;
// Maps our internal keycodes to XKB keycodes
pub fn internal_to_xkb_keycode(internal_code: c_uint) -> u32 {
// XKB keycodes start at 8, so we need to offset them
internal_code as u32 + 8
internal_code + 8
}
5 changes: 1 addition & 4 deletions src/linux/x11/grab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,7 @@ fn setup_inotify(epoll_fd: RawFd, devices: &[Device]) -> io::Result<Inotify> {
//Ensure there is space for inotify at last epoll index.
if devices.len() as u64 >= INOTIFY_DATA {
eprintln!("number of devices: {}", devices.len());
return Err(io::Error::new(
io::ErrorKind::Other,
"too many device files!",
));
return Err(io::Error::other("too many device files!"));
}
// Set up inotify to listen for new devices being plugged in
let inotify = inotify_devices()?;
Expand Down
9 changes: 9 additions & 0 deletions src/rdev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@ pub enum Key {
Kp9,
KpDelete,
Function,
VolumeUp,
VolumeDown,
VolumeMute,
BrightnessUp,
BrightnessDown,
PreviousTrack,
PlayPause,
PlayCd,
NextTrack,
Unknown(u32),
}

Expand Down
8 changes: 7 additions & 1 deletion src/windows/keycodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ decl_keycodes! {
Kp7, 103,
Kp8, 104,
Kp9, 105,
KpDelete, 110
KpDelete, 110,
VolumeMute, 173,
VolumeDown, 174,
VolumeUp, 175,
NextTrack, 176,
PreviousTrack, 177,
PlayPause, 179
}

#[cfg(test)]
Expand Down
Loading