Table of Contents

Class MaaController

Namespace
MaaFramework.Binding
Assembly
MaaFramework.Binding.Native.dll

A wrapper class providing a reference implementation for MaaFramework.Binding.Interop.Native.MaaController.

public class MaaController : MaaCommon, IMaaController<nint>, IMaaController, IMaaCommon, IMaaOption<ControllerOption>, IMaaPost, IMaaDisposableHandle<nint>, IMaaDisposable, IDisposable

Inheritance

Derived

Implements

Inherited Members

Extension Methods

Constructors

MaaController()

Creates a MaaFramework.Binding.MaaController instance.

Properties

IsConnected

Gets whether the MaaFramework.Binding.IMaaController is connected to the device specified by the constructor.

LastJob

Gets the last posted job.

Uuid

Gets the uuid string of the MaaFramework.Binding.IMaaController.

Methods

Click(int, int)

Clicks a point.

ClickKey(int)

Clicks a key.

For adb controller, keyCode is from android key event.

For win32 controller, keyCode is from windows virtual key.

GetCachedImage(IMaaImageBuffer)

Gets the cached image.

GetCachedImage(MaaImageBuffer)

Gets the cached image.

GetStatus(MaaJob)

Gets the current status of a MaaFramework.Binding.MaaJob.

InputText(string)

Inputs a text.

KeyDown(int)

Usage: KeyDown -> KeyUp.

For adb controller, keyCode is from android key event.

For win32 controller, keyCode is from windows virtual key.

KeyUp(int)

Usage: KeyDown -> KeyUp.

For adb controller, keyCode is from android key event.

For win32 controller, keyCode is from windows virtual key.

LinkStart()

Connects the device specified by the constructor.

LinkStartOnConstructed(CheckStatusOption, params object?[])

Connects the address specified by the constructor on constructed.

PressKey(int)

Presses a key.

For adb controller, keyCode is from android key event.

For win32 controller, keyCode is from windows virtual key.

ReleaseHandle(nint)

When overridden in a derived class, executes the code required to free the handle.

Screencap()

Takes a screenshot.

SetOption<T>(ControllerOption, T)

Sets value to an option.

StartApp(string)

Starts an app.

StopApp(string)

Stops an app.

Swipe(int, int, int, int, int)

Swipes from a starting point to an ending point with duration.

TouchDown(int, int, int, int)

Usage: TouchDown -> TouchMove -> TouchUp.

For adb controller, contact means finger id (0 for first finger, 1 for second finger, etc.).

For win32 controller, contact means mouse button id (0 for left, 1 for right, 2 for middle).

TouchMove(int, int, int, int)

Usage: TouchDown -> TouchMove -> TouchUp.

For adb controller, contact means finger id (0 for first finger, 1 for second finger, etc.).

For win32 controller, contact means mouse button id (0 for left, 1 for right, 2 for middle).

TouchUp(int)

Usage: TouchDown -> TouchMove -> TouchUp.

For adb controller, contact means finger id (0 for first finger, 1 for second finger, etc.).

For win32 controller, contact means mouse button id (0 for left, 1 for right, 2 for middle).

Wait(MaaJob)

Waits a MaaFramework.Binding.MaaJob.