diff --git a/Cargo.toml b/Cargo.toml index 5673fe4..7ea3a95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,3 +3,7 @@ resolver = "2" members = ["android-activity"] exclude = ["examples"] + +[patch.crates-io] +ndk = { git = "https://github.com/rust-mobile/ndk", rev = "3bd4388" } +ndk-sys = { git = "https://github.com/rust-mobile/ndk", rev = "3bd4388" } diff --git a/android-activity/src/native_activity/input.rs b/android-activity/src/native_activity/input.rs index 3f15e35..1a1565d 100644 --- a/android-activity/src/native_activity/input.rs +++ b/android-activity/src/native_activity/input.rs @@ -262,13 +262,8 @@ impl<'a> PointerImpl<'a> { #[inline] pub fn axis_value(&self, axis: Axis) -> f32 { let value: u32 = axis.into(); - if let Ok(ndk_axis) = value.try_into() { - self.ndk_pointer.axis_value(ndk_axis) - } else { - // FIXME: We should also be able to query `Axis::__Unknown(u32)` values - // that can't currently be queried via the `ndk` `Pointer` API - 0.0f32 - } + let value = value as i32; + self.ndk_pointer.axis_value(value.into()) } #[inline] @@ -283,7 +278,8 @@ impl<'a> PointerImpl<'a> { #[inline] pub fn tool_type(&self) -> ToolType { - let value: u32 = self.ndk_pointer.tool_type().into(); + let value: i32 = self.ndk_pointer.tool_type().into(); + let value = value as u32; value.into() } } diff --git a/android-activity/src/native_activity/mod.rs b/android-activity/src/native_activity/mod.rs index 8a95cc0..2adcd52 100644 --- a/android-activity/src/native_activity/mod.rs +++ b/android-activity/src/native_activity/mod.rs @@ -507,6 +507,7 @@ impl<'a> InputIteratorInner<'a> { ndk::event::InputEvent::KeyEvent(e) => { input::InputEvent::KeyEvent(input::KeyEvent::new(e)) } + _ => todo!("NDK added a new type"), }; // `finish_event` needs to be called for each event otherwise