diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-04-11 15:48:15 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-11 14:27:33 +1000 |
commit | e7150db5350bc2113ff4126019b489847a4dc217 (patch) | |
tree | 9abc6760690e5c3600a716d159e55ba77d98970a /hw/kdrive | |
parent | 1b8593a6c12315b1071a4fa586151e12f46458f5 (diff) |
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 <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'hw/kdrive')
-rw-r--r-- | hw/kdrive/src/kinput.c | 18 |
1 files changed, 5 insertions, 13 deletions
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 |