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/xwin | |
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/xwin')
-rw-r--r-- | hw/xwin/winkeybd.c | 6 | ||||
-rw-r--r-- | hw/xwin/winmouse.c | 15 |
2 files changed, 5 insertions, 16 deletions
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 912e2de1c..cf0dea22e 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -473,7 +473,6 @@ void winSendKeyEvent (DWORD dwKey, Bool fDown) { EventListPtr events; - int i, nevents; /* * When alt-tabing between screens we can get phantom key up messages @@ -485,10 +484,7 @@ winSendKeyEvent (DWORD dwKey, Bool fDown) g_winKeyState[dwKey] = fDown; GetEventList(&events); - nevents = GetKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL); - - for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinKeyboard, (InternalEvent*)events[i].event); + QueueKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL); winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", dwKey, fDown, nevents); diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c index 080e09626..0e36687cf 100644 --- a/hw/xwin/winmouse.c +++ b/hw/xwin/winmouse.c @@ -235,7 +235,6 @@ void winMouseButtonsSendEvent (int iEventType, int iButton) { EventListPtr events; - int i, nevents; ValuatorMask mask; if (g_winMouseButtonMap) @@ -243,11 +242,8 @@ winMouseButtonsSendEvent (int iEventType, int iButton) valuator_mask_zero(&mask); GetEventList(&events); - nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton, - POINTER_RELATIVE, &mask); - - for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event); + QueuePointerEvents(events, g_pwinPointer, iEventType, iButton, + POINTER_RELATIVE, &mask); #if CYGDEBUG ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d, nEvents %d\n", @@ -367,7 +363,6 @@ winMouseButtonsHandle (ScreenPtr pScreen, */ void winEnqueueMotion(int x, int y) { - int i, nevents; int valuators[2]; ValuatorMask mask; EventListPtr events; @@ -378,9 +373,7 @@ void winEnqueueMotion(int x, int y) valuator_mask_set_range(&mask, 0, 2, valuators); GetEventList(&events); - nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0, - POINTER_ABSOLUTE | POINTER_SCREEN, &mask); + QueuePointerEvents(events, g_pwinPointer, MotionNotify, 0, + POINTER_ABSOLUTE | POINTER_SCREEN, &mask); - for (i = 0; i < nevents; i++) - mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event); } |