2020-02-27 12:01:09 +00:00
|
|
|
#ifndef __qwaq_event_h
|
|
|
|
#define __qwaq_event_h
|
|
|
|
|
|
|
|
typedef enum {
|
2020-03-04 13:09:40 +00:00
|
|
|
qe_mousedown = 0x0001,
|
|
|
|
qe_mouseup = 0x0002,
|
|
|
|
qe_mouseclick= 0x0004,
|
|
|
|
qe_mousemove = 0x0008,
|
|
|
|
qe_mouseauto = 0x0010,
|
|
|
|
} qwaq_mouse_event;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
qe_keydown = 0x0020,
|
|
|
|
} qwaq_key_event;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
qe_command = 0x0200, // application level command
|
|
|
|
qe_broadcast = 0x0400,
|
2020-03-23 11:14:32 +00:00
|
|
|
qe_resize = 0x0800, // screen resized
|
2020-03-04 13:09:40 +00:00
|
|
|
} qwaq_message_event;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
qe_none = 0x0000,
|
|
|
|
qe_mouse = 0x001f,
|
|
|
|
qe_key = 0x0020,
|
|
|
|
qe_system = 0x01c0,
|
|
|
|
qe_message = 0xfe00,
|
|
|
|
|
|
|
|
qe_focused = qe_key | qe_command,
|
2020-03-05 06:44:53 +00:00
|
|
|
qe_positional = qe_mouse,
|
2020-03-04 13:09:40 +00:00
|
|
|
} qwaq_event_mask;
|
2020-02-27 12:01:09 +00:00
|
|
|
|
2020-02-29 15:40:55 +00:00
|
|
|
typedef enum {
|
|
|
|
qc_valid,
|
|
|
|
qc_exit,
|
|
|
|
qc_error,
|
|
|
|
} qwaq_command;
|
|
|
|
|
2020-02-27 12:01:09 +00:00
|
|
|
typedef struct qwaq_mevent_s {
|
2020-02-27 12:08:12 +00:00
|
|
|
int x, y;
|
2020-03-21 16:00:05 +00:00
|
|
|
int buttons; // current button state
|
2020-03-04 13:09:40 +00:00
|
|
|
int click;
|
2020-02-27 12:01:09 +00:00
|
|
|
} qwaq_mevent_t;
|
|
|
|
|
2020-03-22 04:47:44 +00:00
|
|
|
typedef struct qwaq_kevent_s {
|
|
|
|
int code;
|
|
|
|
int shift;
|
|
|
|
} qwaq_kevent_t;
|
|
|
|
|
2020-03-23 11:14:32 +00:00
|
|
|
typedef struct qwaq_resize_s {
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
} qwaq_resize_t;
|
|
|
|
|
2020-02-29 15:40:55 +00:00
|
|
|
typedef struct qwaq_message_s {
|
|
|
|
qwaq_command command;
|
|
|
|
} qwaq_message_t;
|
|
|
|
|
2020-02-27 12:01:09 +00:00
|
|
|
typedef struct qwaq_event_s {
|
2020-03-04 13:09:40 +00:00
|
|
|
int what;
|
2020-03-21 16:00:05 +00:00
|
|
|
double when; // NOTE: 1<<32 based
|
2020-02-27 12:01:09 +00:00
|
|
|
union {
|
2020-03-22 04:47:44 +00:00
|
|
|
qwaq_kevent_t key;
|
2020-02-27 12:01:09 +00:00
|
|
|
qwaq_mevent_t mouse;
|
2020-02-29 15:40:55 +00:00
|
|
|
qwaq_message_t message;
|
2020-03-23 11:14:32 +00:00
|
|
|
qwaq_resize_t resize;
|
2020-03-04 10:10:09 +00:00
|
|
|
};
|
2020-02-27 12:01:09 +00:00
|
|
|
} qwaq_event_t;
|
|
|
|
|
|
|
|
#endif//__qwaq_event_h
|