maix.touchscreen
maix.touchscreen module
You can use
maix.touchscreen
to access this module with MaixPy
This module is generated from MaixCDK
Module
No module
Enum
Variable
Function
Class
TouchScreen
item | doc |
---|---|
brief | TouchScreen class |
C++ defination code:
class TouchScreen
__init__
item | doc |
---|---|
type | func |
brief | Construct a new TouchScreen object |
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
item | doc |
---|---|
type | func |
brief | open touchscreen device |
return | error code, err::ERR_NONE means success, others means failed |
static | False |
C++ defination code:
err::Err open()
close
item | doc |
---|---|
type | func |
brief | close touchscreen device |
return | error code, err::ERR_NONE means success, others means failed |
static | False |
C++ defination code:
err::Err close()
read
item | doc |
---|---|
type | func |
brief | read touchscreen device |
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 1)
item | doc |
---|---|
type | func |
brief | read touchscreen device |
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
item | doc |
---|---|
type | func |
brief | If we need to read from touchscreen, for event driven touchscreen means have event or not |
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
item | doc |
---|---|
type | func |
brief | Check if touchscreen is opened |
return | true if touchscreen is opened, false if not |
static | False |
C++ defination code:
bool is_opened()