[qwaq] Remove unnecessary fields from mouse events

id and z seem to always be 0.

Ironically, it turns out that the work needed for "int id" and "large"
struct nil init wasn't strictly necessary to get to this point, but
without having done that work, I wouldn't know :)
This commit is contained in:
Bill Currie 2020-02-27 21:08:12 +09:00
parent 08bf8a04e4
commit a3ed5926b9
3 changed files with 2 additions and 7 deletions

View file

@ -9,8 +9,7 @@ typedef enum {
// right now, this is just a copy of ncurses MEVENT, but all int
typedef struct qwaq_mevent_s {
int id; // XXX does it matter?
int x, y, z; // z? what?
int x, y;
int buttons;
} qwaq_mevent_t;

View file

@ -27,11 +27,9 @@ int main (int argc, string *argv)
ch = event.e.key;
wprintf (win, "key: %d\n", ch);
} else if (event.event_type == qe_mouse) {
wprintf (win, "mouse: %d %d %d %d %d\n",
event.e.mouse.id,
wprintf (win, "mouse: %d %d %d\n",
event.e.mouse.x,
event.e.mouse.y,
event.e.mouse.z,
event.e.mouse.buttons);
}
}

View file

@ -201,10 +201,8 @@ mouse_event (qwaq_resources_t *res, MEVENT *mevent)
{
qwaq_event_t event = {};
event.event_type = qe_mouse;
event.e.mouse.id = mevent->id;
event.e.mouse.x = mevent->x;
event.e.mouse.y = mevent->y;
event.e.mouse.z = mevent->z;
event.e.mouse.buttons = mevent->bstate;
add_event (res, &event);
}