Hi. I've only tested on ARMv7, but I'd assume the problem exists with any 32-bit linux. On 32-bit linux, the timeval struct, which is part of the input_event struct, uses 32-bit longs. However, the struct is hard-coded for 64-bit longs.
I fixed this for ARMv7 with the following change:
diff --git a/src/linux_wayland/ffi/input.rs b/src/linux_wayland/ffi/input.rs
index a8c6b08..3447684 100644
--- a/src/linux_wayland/ffi/input.rs
+++ b/src/linux_wayland/ffi/input.rs
@@ -1,11 +1,13 @@
// https://github.com/torvalds/linux/blob/master/include/uapi/linux/input.h
+use std::ffi::c_long;
+
#[repr(C)]
#[allow(non_camel_case_types)]
pub struct timeval {
// Not quite sure if these should be 32 or 64
- pub tv_sec: i64,
- pub tv_usec: i64,
+ pub tv_sec: c_long,
+ pub tv_usec: c_long,
}
#[repr(C)]
Hi. I've only tested on ARMv7, but I'd assume the problem exists with any 32-bit linux. On 32-bit linux, the timeval struct, which is part of the input_event struct, uses 32-bit longs. However, the struct is hard-coded for 64-bit longs.
I fixed this for ARMv7 with the following change: