From e7150db5350bc2113ff4126019b489847a4dc217 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 11 Apr 2011 15:48:15 +1000 Subject: input: Provide Queue{Button|Keyboard|Proximity}Event helpers Don't require every caller to use GPE + mieqEnqueue, provide matching Queue...Event functions instead. Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston --- hw/kdrive/src/kinput.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'hw/kdrive') diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index f21475fb6..521542c91 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -1793,7 +1793,7 @@ void KdReleaseAllKeys (void) { #if 0 - int key, nEvents, i; + int key; KdKeyboardInfo *ki; KdBlockSigio (); @@ -1804,9 +1804,7 @@ KdReleaseAllKeys (void) if (key_is_down(ki->dixdev, key, KEY_POSTED | KEY_PROCESSED)) { KdHandleKeyboardEvent(ki, KeyRelease, key); GetEventList(&kdEvents); - nEvents = GetKeyboardEvents(kdEvents, ki->dixdev, KeyRelease, key, NULL); - for (i = 0; i < nEvents; i++) - KdQueueEvent (ki->dixdev, (kdEvents + i)->event); + QueueGetKeyboardEvents(kdEvents, ki->dixdev, KeyRelease, key, NULL); } } } @@ -1842,7 +1840,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki, unsigned char key_code; KeyClassPtr keyc = NULL; KeybdCtrl *ctrl = NULL; - int type, nEvents, i; + int type; if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed || !ki->dixdev->key) return; @@ -1863,10 +1861,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki, type = KeyPress; GetEventList(&kdEvents); - - nEvents = GetKeyboardEvents(kdEvents, ki->dixdev, type, key_code, NULL); - for (i = 0; i < nEvents; i++) - KdQueueEvent(ki->dixdev, (InternalEvent *)((kdEvents + i)->event)); + QueueKeyboardEvents(kdEvents, ki->dixdev, type, key_code, NULL); } else { ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n", @@ -1965,7 +1960,6 @@ void _KdEnqueuePointerEvent (KdPointerInfo *pi, int type, int x, int y, int z, int b, int absrel, Bool force) { - int nEvents = 0, i = 0; int valuators[3] = { x, y, z }; ValuatorMask mask; @@ -1976,9 +1970,7 @@ _KdEnqueuePointerEvent (KdPointerInfo *pi, int type, int x, int y, int z, valuator_mask_set_range(&mask, 0, 3, valuators); GetEventList(&kdEvents); - nEvents = GetPointerEvents(kdEvents, pi->dixdev, type, b, absrel, &mask); - for (i = 0; i < nEvents; i++) - KdQueueEvent(pi->dixdev, (InternalEvent *)((kdEvents + i)->event)); + QueuePointerEvents(kdEvents, pi->dixdev, type, b, absrel, &mask); } void -- cgit v1.2.3