MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / send_button

Method send_button

packages/server/src/native/bridge.rs:710–736  ·  view source on GitHub ↗
(
        &self,
        udid: &str,
        button: &str,
        pressed: bool,
        usage_page: Option<u32>,
        usage: Option<u32>,
    )

Source from the content-addressed store, hash-verified

708 }
709
710 pub fn send_button(
711 &self,
712 udid: &str,
713 button: &str,
714 pressed: bool,
715 usage_page: Option<u32>,
716 usage: Option<u32>,
717 ) -> Result<(), AppError> {
718 let udid = CString::new(udid).map_err(|e| AppError::bad_request(e.to_string()))?;
719 let button = CString::new(button).map_err(|e| AppError::bad_request(e.to_string()))?;
720 let has_usage = usage_page.is_some() && usage.is_some();
721 unsafe {
722 let mut error = ptr::null_mut();
723 bool_result(
724 ffi::xcw_native_send_button(
725 udid.as_ptr(),
726 button.as_ptr(),
727 pressed,
728 has_usage,
729 usage_page.unwrap_or(0),
730 usage.unwrap_or(0),
731 &mut error,
732 ),
733 error,
734 )
735 }
736 }
737
738 pub fn rotate_crown(&self, udid: &str, delta: f64) -> Result<(), AppError> {
739 if !delta.is_finite() {

Callers 2

run_batch_stepFunction · 0.45
run_control_messageFunction · 0.45

Calls 3

bool_resultFunction · 0.85
xcw_native_send_buttonFunction · 0.85

Tested by

no test coverage detected