mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 18:31:27 +00:00
Implement mouse auto events
These are for when a button is held down: good for scroll bar arrows etc.
This commit is contained in:
parent
5cdd1931b7
commit
f3c68eaada
4 changed files with 14 additions and 2 deletions
|
@ -66,8 +66,11 @@
|
|||
}
|
||||
break;
|
||||
case qe_mouseauto:
|
||||
click = 0;
|
||||
action = onAuto;
|
||||
if (pressed
|
||||
&& [self containsPoint: {event.mouse.x, event.mouse.y}]) {
|
||||
click = 0;
|
||||
action = onAuto;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (action) {
|
||||
|
|
|
@ -712,6 +712,11 @@ get_event (qwaq_resources_t *res, qwaq_event_t *event)
|
|||
if (ret == 0) {
|
||||
RB_READ_DATA (res->event_queue, event, 1);
|
||||
was_event = 1;
|
||||
} else if (res->button_state) {
|
||||
event->what = qe_mouseauto;
|
||||
event->mouse.buttons = res->button_state;
|
||||
event->mouse.x = res->mouse_x;
|
||||
event->mouse.y = res->mouse_y;
|
||||
} else {
|
||||
event->what = qe_none;
|
||||
}
|
||||
|
|
|
@ -188,6 +188,8 @@ typedef struct qwaq_resources_s {
|
|||
dstring_t escbuff;
|
||||
esc_state_t escstate;
|
||||
unsigned button_state;
|
||||
int mouse_x;
|
||||
int mouse_y;
|
||||
qwaq_event_t lastClick;
|
||||
struct hashtab_s *key_sequences;
|
||||
} qwaq_resources_t;
|
||||
|
|
|
@ -266,6 +266,8 @@ parse_mouse (qwaq_resources_t *res, unsigned ctrl, int x, int y, int cmd)
|
|||
}
|
||||
}
|
||||
}
|
||||
res->mouse_x = x;
|
||||
res->mouse_y = y;
|
||||
mouse_event (res, what, x, y);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue