From df076342a5bf7002897e6378387b37587d852b9d Mon Sep 17 00:00:00 2001 From: nahco314 Date: Sat, 26 Oct 2024 15:31:39 +0900 Subject: [PATCH] fix: fix a trivial type problem in windows --- src/utils.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 7196a91..fa0ed50 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -96,7 +96,7 @@ pub fn create_screen_info() -> Result> { pub fn get_auto_repeat_rate() -> Result { let rate = unsafe { bindings::hook_get_auto_repeat_rate() }; if rate >= 0 { - Ok(rate) + Ok(rate as i64) } else { Err(UiohookError::Unknown(rate as u32)) } @@ -125,7 +125,7 @@ pub fn get_auto_repeat_rate() -> Result { pub fn get_auto_repeat_delay() -> Result { let delay = unsafe { bindings::hook_get_auto_repeat_delay() }; if delay >= 0 { - Ok(delay) + Ok(delay as i64) } else { Err(UiohookError::Unknown(delay as u32)) } @@ -154,7 +154,7 @@ pub fn get_auto_repeat_delay() -> Result { pub fn get_pointer_acceleration_multiplier() -> Result { let multiplier = unsafe { bindings::hook_get_pointer_acceleration_multiplier() }; if multiplier >= 0 { - Ok(multiplier) + Ok(multiplier as i64) } else { Err(UiohookError::Unknown(multiplier as u32)) } @@ -183,7 +183,7 @@ pub fn get_pointer_acceleration_multiplier() -> Result { pub fn get_pointer_acceleration_threshold() -> Result { let threshold = unsafe { bindings::hook_get_pointer_acceleration_threshold() }; if threshold >= 0 { - Ok(threshold) + Ok(threshold as i64) } else { Err(UiohookError::Unknown(threshold as u32)) } @@ -212,7 +212,7 @@ pub fn get_pointer_acceleration_threshold() -> Result { pub fn get_pointer_sensitivity() -> Result { let sensitivity = unsafe { bindings::hook_get_pointer_sensitivity() }; if sensitivity >= 0 { - Ok(sensitivity) + Ok(sensitivity as i64) } else { Err(UiohookError::Unknown(sensitivity as u32)) } @@ -241,7 +241,7 @@ pub fn get_pointer_sensitivity() -> Result { pub fn get_multi_click_time() -> Result { let time = unsafe { bindings::hook_get_multi_click_time() }; if time >= 0 { - Ok(time) + Ok(time as i64) } else { Err(UiohookError::Unknown(time as u32)) }