mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-14 02:36:51 -07:00
Make setsu events nicer
This commit is contained in:
parent
aabb305eef
commit
43dd40e466
3 changed files with 87 additions and 43 deletions
|
@ -18,27 +18,29 @@
|
|||
#ifndef _SETSU_H
|
||||
#define _SETSU_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct setsu_t Setsu;
|
||||
typedef struct setsu_device_t SetsuDevice;
|
||||
typedef int SetsuTrackingId;
|
||||
|
||||
typedef enum {
|
||||
SETSU_EVENT_DOWN,
|
||||
SETSU_EVENT_UP,
|
||||
SETSU_EVENT_POSITION_X,
|
||||
SETSU_EVENT_POSITION_Y
|
||||
SETSU_EVENT_POSITION
|
||||
} SetsuEventType;
|
||||
|
||||
typedef struct setsu_event_t {
|
||||
SetsuDevice *dev;
|
||||
unsigned int tracking_id;
|
||||
SetsuTrackingId tracking_id;
|
||||
SetsuEventType type;
|
||||
unsigned int value;
|
||||
uint32_t x, y;
|
||||
} SetsuEvent;
|
||||
|
||||
typedef void (*SetsuEventCb)(SetsuEvent *event, void *user);
|
||||
|
||||
Setsu *setsu_new();
|
||||
void setsu_free(Setsu *setsu);
|
||||
void setsu_poll(Setsu *setsu, SetsuEventCb cb);
|
||||
void setsu_poll(Setsu *setsu, SetsuEventCb cb, void *user);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue