mirror of
https://github.com/rfc2822/GfxTablet
synced 2025-10-05 18:34:18 +02:00
28 lines
507 B
C
28 lines
507 B
C
#define GFXTABLET_PORT 40118
|
|
|
|
#define PROTOCOL_VERSION 2
|
|
|
|
|
|
#pragma pack(push)
|
|
#pragma pack(1)
|
|
|
|
#define EVENT_TYPE_MOTION 0
|
|
#define EVENT_TYPE_BUTTON 1
|
|
|
|
struct event_packet
|
|
{
|
|
char signature[9];
|
|
uint16_t version;
|
|
uint8_t type; /* EVENT_TYPE_... */
|
|
struct { /* required */
|
|
uint16_t x, y;
|
|
uint16_t pressure;
|
|
};
|
|
|
|
struct { /* only required for EVENT_TYPE_BUTTON */
|
|
int8_t button; /* number of button, beginning with 1 */
|
|
int8_t down; /* 1 = button down, 0 = button up */
|
|
};
|
|
};
|
|
|
|
#pragma pack(pop)
|