pub struct MaaControllerInstance<T> { /* private fields */ }
Expand description
Implementations§
Source§impl<T> MaaControllerInstance<T>
impl<T> MaaControllerInstance<T>
Sourcepub fn new_adb(
adb_path: &str,
address: &str,
controller_type: MaaAdbControllerType,
config: &str,
agent_path: &str,
handler: Option<T>,
) -> Selfwhere
T: CallbackHandler,
Available on crate feature adb
only.
pub fn new_adb(
adb_path: &str,
address: &str,
controller_type: MaaAdbControllerType,
config: &str,
agent_path: &str,
handler: Option<T>,
) -> Selfwhere
T: CallbackHandler,
adb
only.Create a new AdbController
§Notes
This directly calls MaaAdbControllerCreateV2 since MaaAdbControllerCreate is deprecated
pub fn new_win32(
hwnd: MaaWin32Hwnd,
controller_type: MaaWin32ControllerType,
handler: Option<T>,
) -> Selfwhere
T: CallbackHandler,
Available on crate feature
win32
only.pub fn new_dbg(
read_path: &str,
write_path: &str,
controller_type: MaaDbgControllerType,
config: &str,
handler: Option<T>,
) -> Selfwhere
T: CallbackHandler,
Available on crate feature
dbg
only.pub fn new_custom<C>(controller: C, handler: Option<T>) -> Selfwhere
T: CallbackHandler,
C: MaaCustomController,
Available on crate feature
custom_controller
only.pub fn set_controller_option( &self, option: MaaControllerOption, ) -> MaaResult<()>
pub fn post_connect(&self) -> MaaCtrlId
pub fn post_click(&self, x: i32, y: i32) -> MaaCtrlId
pub fn post_swipe( &self, x1: i32, y1: i32, x2: i32, y2: i32, duration: i32, ) -> MaaCtrlId
pub fn post_press_key(&self, keycode: i32) -> MaaCtrlId
pub fn post_input_text(&self, text: &str) -> MaaCtrlId
pub fn post_touch_down( &self, contact: i32, x: i32, y: i32, pressure: i32, ) -> MaaCtrlId
pub fn post_touch_move( &self, contact: i32, x: i32, y: i32, pressure: i32, ) -> MaaCtrlId
pub fn post_touch_up(&self, contact: i32) -> MaaCtrlId
pub fn post_screencap(&self) -> MaaCtrlId
pub fn status(&self, id: MaaCtrlId) -> MaaResult<MaaStatus>
pub fn wait(&self, id: MaaCtrlId) -> MaaResult<MaaStatus>
pub fn connected(&self) -> bool
Trait Implementations§
Source§impl<T> Deref for MaaControllerInstance<T>
impl<T> Deref for MaaControllerInstance<T>
Source§impl<T> Drop for MaaControllerInstance<T>
impl<T> Drop for MaaControllerInstance<T>
impl<T> Send for MaaControllerInstance<T>
impl<T> Sync for MaaControllerInstance<T>
Auto Trait Implementations§
impl<T> Freeze for MaaControllerInstance<T>
impl<T> RefUnwindSafe for MaaControllerInstance<T>where
T: RefUnwindSafe,
impl<T> Unpin for MaaControllerInstance<T>where
T: Unpin,
impl<T> UnwindSafe for MaaControllerInstance<T>where
T: UnwindSafe,
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