Add Buttons to Setsu

This commit is contained in:
Florian Märkl 2020-07-03 18:18:50 +02:00
commit abec268ab6
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
3 changed files with 112 additions and 46 deletions

View file

@ -42,17 +42,27 @@ typedef enum {
/* Touch down.
* Event will have dev and tracking_id set. */
SETSU_EVENT_DOWN,
SETSU_EVENT_TOUCH_DOWN,
/* Touch down.
* Event will have dev and tracking_id set. */
SETSU_EVENT_UP,
SETSU_EVENT_TOUCH_UP,
/* Touch position update.
* Event will have dev, tracking_id, x and y set. */
SETSU_EVENT_POSITION
SETSU_EVENT_TOUCH_POSITION,
/* Event will have dev and button set. */
SETSU_EVENT_BUTTON_DOWN,
/* Event will have dev and button set. */
SETSU_EVENT_BUTTON_UP
} SetsuEventType;
#define SETSU_BUTTON_0 (1u << 0)
typedef uint64_t SetsuButton;
typedef struct setsu_event_t
{
SetsuEventType type;
@ -62,8 +72,15 @@ typedef struct setsu_event_t
struct
{
SetsuDevice *dev;
SetsuTrackingId tracking_id;
uint32_t x, y;
union
{
struct
{
SetsuTrackingId tracking_id;
uint32_t x, y;
};
SetsuButton button;
};
};
};
} SetsuEvent;