maix::touchscreen

maix.touchscreen module

This is maix::touchscreen module of MaixCDK.
All of these elements are in namespace maix::touchscreen.

For MaixCDK developer: DO NOT edit this doc file manually, this doc is auto generated!

Module

No module

Enum

Variable

Function

Class

TouchScreen

TouchScreen class

C++ defination code:

class TouchScreen

TouchScreen

Construct a new TouchScreen object

item description
type func
param device: touchscreen device path, you can get devices by list_devices method, by default(value is NULL(None in MaixPy)) means the first device
open: If true, touchscreen will automatically call open() after creation. default is true.
static False

C++ defination code:

TouchScreen(const std::string &device = "", bool open = true)

open

open touchscreen device

item description
type func
return error code, err::ERR_NONE means success, others means failed
static False

C++ defination code:

err::Err open()

close

close touchscreen device

item description
type func
return error code, err::ERR_NONE means success, others means failed
static False

C++ defination code:

err::Err close()

read

read touchscreen device.

item description
type func
attention This method will discard same event in buffer, that is:
if too many move event in buffer when call this method, it will only return the last one,
and if read pressed or released event, it will return immediately.
param x: x coordinate
y: y coordinate
pressed: pressed state
return error code, err::ERR_NONE means success, others means failed, if no event return err::ERR_NOT_READY
static False

C++ defination code:

err::Err read(int &x, int &y, bool &pressed)

read (overload 1)

read touchscreen device

item description
type func
attention This method will discard same event in buffer, that is:
if too many move event in buffer when call this method, it will only return the last one,
and if read pressed or released event, it will return immediately.
return Returns a list include x, y, pressed state
static False

C++ defination code:

std::vector<int> read()

read (overload 2)

read touchscreen device

item description
type func
attention This method will return immediately if have event, so it's better to use available() to check if have more event in buffer,
or too much event in buffer when your program call this read() interval is too long will make your program slow.
param x: x coordinate
y: y coordinate
pressed: pressed state
return error code, err::ERR_NONE means success, others means failed, if no event return err::ERR_NOT_READY
static False

C++ defination code:

err::Err read0(int &x, int &y, bool &pressed)

read (overload 3)

read touchscreen device

item description
type func
attention This method will return immediately if have event, so it's better to use available() to check if have more event in buffer,
or too much event in buffer when your program call this read() interval is too long will make your program slow.
return Returns a list include x, y, pressed state
static False

C++ defination code:

std::vector<int> read0()

available

If we need to read from touchscreen, for event driven touchscreen means have event or not

item description
type func
param timeout: -1 means block, 0 means no block, >0 means timeout, default is 0, unit is ms.
return true if need to read(have event), false if not
static False

C++ defination code:

bool available(int timeout = 0)

is_opened

Check if touchscreen is opened

item description
type func
return true if touchscreen is opened, false if not
static False

C++ defination code:

bool is_opened()