#[repr(C)]pub struct MaaCustomControllerCallbacks {Show 17 fields
pub connect: Option<unsafe extern "C" fn(trans_arg: *mut c_void) -> MaaBool>,
pub connected: Option<unsafe extern "C" fn(trans_arg: *mut c_void) -> MaaBool>,
pub request_uuid: Option<unsafe extern "C" fn(trans_arg: *mut c_void, buffer: *mut MaaStringBuffer) -> MaaBool>,
pub get_features: Option<unsafe extern "C" fn(trans_arg: *mut c_void) -> MaaControllerFeature>,
pub start_app: Option<unsafe extern "C" fn(intent: *const c_char, trans_arg: *mut c_void) -> MaaBool>,
pub stop_app: Option<unsafe extern "C" fn(intent: *const c_char, trans_arg: *mut c_void) -> MaaBool>,
pub screencap: Option<unsafe extern "C" fn(trans_arg: *mut c_void, buffer: *mut MaaImageBuffer) -> MaaBool>,
pub click: Option<unsafe extern "C" fn(x: i32, y: i32, trans_arg: *mut c_void) -> MaaBool>,
pub swipe: Option<unsafe extern "C" fn(x1: i32, y1: i32, x2: i32, y2: i32, duration: i32, trans_arg: *mut c_void) -> MaaBool>,
pub touch_down: Option<unsafe extern "C" fn(contact: i32, x: i32, y: i32, pressure: i32, trans_arg: *mut c_void) -> MaaBool>,
pub touch_move: Option<unsafe extern "C" fn(contact: i32, x: i32, y: i32, pressure: i32, trans_arg: *mut c_void) -> MaaBool>,
pub touch_up: Option<unsafe extern "C" fn(contact: i32, trans_arg: *mut c_void) -> MaaBool>,
pub click_key: Option<unsafe extern "C" fn(keycode: i32, trans_arg: *mut c_void) -> MaaBool>,
pub input_text: Option<unsafe extern "C" fn(text: *const c_char, trans_arg: *mut c_void) -> MaaBool>,
pub key_down: Option<unsafe extern "C" fn(keycode: i32, trans_arg: *mut c_void) -> MaaBool>,
pub key_up: Option<unsafe extern "C" fn(keycode: i32, trans_arg: *mut c_void) -> MaaBool>,
pub scroll: Option<unsafe extern "C" fn(dx: i32, dy: i32, trans_arg: *mut c_void) -> MaaBool>,
}Expand description
@brief The custom controller API.
To create a custom controller, you need to implement this API.
You do not have to implement all the functions in this API. Instead, just implement the functions you need. Do note that if an unimplemented function is called, the framework will likely crash.
Fields§
§connect: Option<unsafe extern "C" fn(trans_arg: *mut c_void) -> MaaBool>§connected: Option<unsafe extern "C" fn(trans_arg: *mut c_void) -> MaaBool>§request_uuid: Option<unsafe extern "C" fn(trans_arg: *mut c_void, buffer: *mut MaaStringBuffer) -> MaaBool>Write result to buffer.
get_features: Option<unsafe extern "C" fn(trans_arg: *mut c_void) -> MaaControllerFeature>§start_app: Option<unsafe extern "C" fn(intent: *const c_char, trans_arg: *mut c_void) -> MaaBool>§stop_app: Option<unsafe extern "C" fn(intent: *const c_char, trans_arg: *mut c_void) -> MaaBool>§screencap: Option<unsafe extern "C" fn(trans_arg: *mut c_void, buffer: *mut MaaImageBuffer) -> MaaBool>Write result to buffer.
click: Option<unsafe extern "C" fn(x: i32, y: i32, trans_arg: *mut c_void) -> MaaBool>§swipe: Option<unsafe extern "C" fn(x1: i32, y1: i32, x2: i32, y2: i32, duration: i32, trans_arg: *mut c_void) -> MaaBool>§touch_down: Option<unsafe extern "C" fn(contact: i32, x: i32, y: i32, pressure: i32, trans_arg: *mut c_void) -> MaaBool>§touch_move: Option<unsafe extern "C" fn(contact: i32, x: i32, y: i32, pressure: i32, trans_arg: *mut c_void) -> MaaBool>§touch_up: Option<unsafe extern "C" fn(contact: i32, trans_arg: *mut c_void) -> MaaBool>§click_key: Option<unsafe extern "C" fn(keycode: i32, trans_arg: *mut c_void) -> MaaBool>§input_text: Option<unsafe extern "C" fn(text: *const c_char, trans_arg: *mut c_void) -> MaaBool>§key_down: Option<unsafe extern "C" fn(keycode: i32, trans_arg: *mut c_void) -> MaaBool>§key_up: Option<unsafe extern "C" fn(keycode: i32, trans_arg: *mut c_void) -> MaaBool>§scroll: Option<unsafe extern "C" fn(dx: i32, dy: i32, trans_arg: *mut c_void) -> MaaBool>Trait Implementations§
Source§impl Clone for MaaCustomControllerCallbacks
impl Clone for MaaCustomControllerCallbacks
Source§fn clone(&self) -> MaaCustomControllerCallbacks
fn clone(&self) -> MaaCustomControllerCallbacks
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MaaCustomControllerCallbacks
impl Debug for MaaCustomControllerCallbacks
impl Copy for MaaCustomControllerCallbacks
Auto Trait Implementations§
impl Freeze for MaaCustomControllerCallbacks
impl RefUnwindSafe for MaaCustomControllerCallbacks
impl Send for MaaCustomControllerCallbacks
impl Sync for MaaCustomControllerCallbacks
impl Unpin for MaaCustomControllerCallbacks
impl UnwindSafe for MaaCustomControllerCallbacks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more