summaryrefslogtreecommitdiff
path: root/hw/xnest/Events.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2005-06-25 21:28:48 +0000
committerAdam Jackson <ajax@nwnk.net>2005-06-25 21:28:48 +0000
commitaa7fb99bc76e62036c73ff50f58337558859b814 (patch)
treeb2e26112b997cca8c4a91f9af2811840fcffcb70 /hw/xnest/Events.c
parent8562f800b879ae461317da9640961f753e107250 (diff)
Bug #3030: Fix Xnest keyboard state handling. (Mark McLoughlin)
Diffstat (limited to 'hw/xnest/Events.c')
-rw-r--r--hw/xnest/Events.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index 482c5fda8..604499f89 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -34,6 +34,7 @@ is" without express or implied warranty.
#include "Screen.h"
#include "XNWindow.h"
#include "Events.h"
+#include "Keyboard.h"
#include "mipointer.h"
CARD32 lastEventTime = 0;
@@ -96,6 +97,16 @@ xnestCollectExposures()
}
void
+xnestQueueKeyEvent(int type, unsigned int keycode)
+{
+ xEvent x;
+ x.u.u.type = type;
+ x.u.u.detail = keycode;
+ x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
+ mieqEnqueue(&x);
+}
+
+void
xnestCollectEvents()
{
XEvent X;
@@ -105,17 +116,13 @@ xnestCollectEvents()
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
switch (X.type) {
case KeyPress:
- x.u.u.type = KeyPress;
- x.u.u.detail = X.xkey.keycode;
- x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&x);
+ xnestUpdateModifierState(X.xkey.state);
+ xnestQueueKeyEvent(KeyPress, X.xkey.keycode);
break;
case KeyRelease:
- x.u.u.type = KeyRelease;
- x.u.u.detail = X.xkey.keycode;
- x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
- mieqEnqueue(&x);
+ xnestUpdateModifierState(X.xkey.state);
+ xnestQueueKeyEvent(KeyRelease, X.xkey.keycode);
break;
case ButtonPress: