Skip to content
Merged
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
13 changes: 10 additions & 3 deletions src/raw_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,16 @@ impl RawDevice {

let props = {
let mut props = AttributeSet::<PropType>::new();
unsafe { sys::eviocgprop(fd.as_raw_fd(), props.as_mut_raw_slice())? };
props
}; // FIXME: handle old kernel

match unsafe { sys::eviocgprop(fd.as_raw_fd(), props.as_mut_raw_slice()) } {
Ok(_) => props,

// Kernel 2.6.x does not implement this ioctl, return empty props
Err(nix::errno::Errno::EINVAL) => props,

Err(e) => return Err(e.into()),
}
};

let supported_keys = if ty.contains(EventType::KEY) {
let mut keys = AttributeSet::<KeyCode>::new();
Expand Down
Loading