mieqProcessInputEvents: Check custom event handlers first.
(cherry picked from commit c9ac2f5753
)
This commit is contained in:
parent
8e3da36b6b
commit
4d03fc22ab
21
mi/mieq.c
21
mi/mieq.c
|
@ -213,25 +213,24 @@ mieqProcessInputEvents(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
e = &miEventQueue.events[miEventQueue.head];
|
e = &miEventQueue.events[miEventQueue.head];
|
||||||
/* Assumption - screen switching can only occur on motion events. */
|
|
||||||
miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE;
|
miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE;
|
||||||
|
|
||||||
if (e->pScreen != miEventQueue.pDequeueScreen) {
|
if (miEventQueue.handlers[e->event->u.u.type]) {
|
||||||
|
/* If someone's registered a custom event handler, let them
|
||||||
|
* steal it. */
|
||||||
|
miEventQueue.handlers[e->event->u.u.type](miEventQueue.pDequeueScreen->myNum,
|
||||||
|
e->event, dev,
|
||||||
|
e->nevents);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (e->pScreen != miEventQueue.pDequeueScreen) {
|
||||||
|
/* Assumption - screen switching can only occur on motion events. */
|
||||||
miEventQueue.pDequeueScreen = e->pScreen;
|
miEventQueue.pDequeueScreen = e->pScreen;
|
||||||
x = e->event[0].u.keyButtonPointer.rootX;
|
x = e->event[0].u.keyButtonPointer.rootX;
|
||||||
y = e->event[0].u.keyButtonPointer.rootY;
|
y = e->event[0].u.keyButtonPointer.rootY;
|
||||||
NewCurrentScreen (miEventQueue.pDequeueScreen, x, y);
|
NewCurrentScreen (miEventQueue.pDequeueScreen, x, y);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* If someone's registered a custom event handler, let them
|
|
||||||
* steal it. */
|
|
||||||
if (miEventQueue.handlers[e->event->u.u.type]) {
|
|
||||||
miEventQueue.handlers[e->event->u.u.type](miEventQueue.pDequeueScreen->myNum,
|
|
||||||
e->event, dev,
|
|
||||||
e->nevents);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If this is a core event, make sure our keymap, et al, is
|
/* If this is a core event, make sure our keymap, et al, is
|
||||||
* changed to suit. */
|
* changed to suit. */
|
||||||
if (e->event[0].u.u.type == KeyPress ||
|
if (e->event[0].u.u.type == KeyPress ||
|
||||||
|
|
Loading…
Reference in New Issue
Block a user