You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
opentrackpadcontroller/lib/touch_controls/include/touch_control.h

44 lines
784 B
C++

#ifndef TOUCH_CONTROL_H
#define TOUCH_CONTROL_H
#include <stdint.h>
class TouchControl
{
public:
enum ControlType: uint8_t{
CT_NONE,
CT_JOYSTICK,
CT_MOUSE_JOYSTICK,
CT_DPAD,
};
protected:
int32_t pos_x;
int32_t pos_y;
int32_t pos_r;
int32_t pos_r2;
ControlType control_type;
int8_t finger_id;
int8_t touching;
public:
TouchControl() {}
TouchControl(int32_t pos_x, int32_t pos_y, int32_t pos_r);
virtual void init(int32_t pos_x, int32_t pos_y, int32_t pos_r);
virtual int8_t touch(int8_t fid, int32_t tx, int32_t ty) = 0;
int8_t getTouching() {return touching;}
ControlType getControlType() {return control_type;}
};
#endif