summaryrefslogtreecommitdiff
path: root/hw/kdrive/src
diff options
context:
space:
mode:
Diffstat (limited to 'hw/kdrive/src')
-rw-r--r--hw/kdrive/src/kdrive.h1
-rw-r--r--hw/kdrive/src/kinput.c18
2 files changed, 15 insertions, 4 deletions
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index bb9bc238d..5f937a5c9 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -276,6 +276,7 @@ typedef struct _KdOsFuncs {
Bool (*SpecialKey) (KeySym);
void (*Disable) (void);
void (*Fini) (void);
+ void (*pollEvents) (void);
} KdOsFuncs;
typedef enum _KdSyncPolarity {
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index eb65cb98a..062d6820a 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1468,7 +1468,8 @@ KdBlockHandler (int screen,
pointer readmask)
{
KdMouseInfo *mi;
-
+ int myTimeout=0;
+
for (mi = kdMouseInfo; mi; mi = mi->next)
{
if (mi->timeoutPending)
@@ -1476,11 +1477,20 @@ KdBlockHandler (int screen,
int ms;
ms = mi->emulationTimeout - GetTimeInMillis ();
- if (ms < 0)
- ms = 0;
- AdjustWaitForDelay (timeout, ms);
+ if (ms < 1)
+ ms = 1;
+ if(ms<myTimeout || myTimeout==0)
+ myTimeout=ms;
}
}
+ /* if we need to poll for events, do that */
+ if(kdOsFuncs->pollEvents)
+ {
+ (*kdOsFuncs->pollEvents)();
+ myTimeout=20;
+ }
+ if(myTimeout>0)
+ AdjustWaitForDelay (timeout, myTimeout);
}
void