summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xwin/InitInput.c3
-rw-r--r--hw/xwin/winkeybd.c20
-rw-r--r--hw/xwin/winmouse.c25
3 files changed, 28 insertions, 20 deletions
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index d7e3f9cba..76c1715cf 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -153,8 +153,7 @@ InitInput (int argc, char *argv[])
g_pwinPointer->name = strdup("Windows mouse");
g_pwinKeyboard->name = strdup("Windows keyboard");
- miRegisterPointerDevice (screenInfo.screens[0], pMouse);
- mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse);
+ mieqInit ();
/* Initialize the mode key states */
winInitializeModeKeyStates ();
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index d574f2053..90cd5af4a 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -580,7 +580,8 @@ winKeybdReleaseKeys ()
void
winSendKeyEvent (DWORD dwKey, Bool fDown)
{
- xEvent xCurrentEvent;
+ EventListPtr events;
+ int i, nevents;
/*
* When alt-tabing between screens we can get phantom key up messages
@@ -590,14 +591,17 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
/* Update the keyState map */
g_winKeyState[dwKey] = fDown;
-
- ZeroMemory (&xCurrentEvent, sizeof (xCurrentEvent));
- xCurrentEvent.u.u.type = fDown ? KeyPress : KeyRelease;
- xCurrentEvent.u.keyButtonPointer.time =
- g_c32LastInputEventTime = GetTickCount ();
- xCurrentEvent.u.u.detail = dwKey + MIN_KEYCODE;
- mieqEnqueue (&xCurrentEvent);
+ GetEventList(&events);
+ nevents = GetKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE);
+
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(g_pwinKeyboard, events[i].event);
+
+#if CYGDEBUG
+ ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n",
+ dwKey, fDown, nevents);
+#endif
}
BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam)
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index be2b66a08..04a2ae10e 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -100,7 +100,6 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
InitPointerDeviceStruct (pDevice,
map,
lngMouseButtons + lngWheelEvents,
- GetMotionHistory,
winMouseCtrl,
GetMotionHistorySize(),
2);
@@ -221,19 +220,25 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
void
winMouseButtonsSendEvent (int iEventType, int iButton)
{
- xEvent xCurrentEvent;
+ EventListPtr events;
+ int i, nevents;
- /* Load an xEvent and enqueue the event */
- xCurrentEvent.u.u.type = iEventType;
#if defined(XFree86Server)
if (g_winMouseButtonMap)
- xCurrentEvent.u.u.detail = g_winMouseButtonMap[iButton];
- else
+ iButton = g_winMouseButtonMap[iButton];
+#endif
+
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton,
+ POINTER_RELATIVE, 0, 0, NULL);
+
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(g_pwinPointer, events[i].event);
+
+#if CYGDEBUG
+ ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d, nEvents %d\n",
+ iEventType, iButton, nevents);
#endif
- xCurrentEvent.u.u.detail = iButton;
- xCurrentEvent.u.keyButtonPointer.time
- = g_c32LastInputEventTime = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
}