summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaymz Julian <jaymz@artificial-stupidity.net>2004-02-05 09:09:51 +0000
committerJaymz Julian <jaymz@artificial-stupidity.net>2004-02-05 09:09:51 +0000
commitbd20c8d340fce0700ae813bd5b55fe7f4b9e0c98 (patch)
treee4b84e6ff91f0dea1c9c9e8d5dcb917b8cc76e6f
parentaf798d27743dbc4f70e85e297daa5863ec89640b (diff)
Polling input mode for the kdrive os layer. And a moose!add-Xi
-rw-r--r--hw/kdrive/itsy/itsy.c1
-rw-r--r--hw/kdrive/linux/linux.c1
-rw-r--r--hw/kdrive/src/kdrive.h1
-rw-r--r--hw/kdrive/src/kinput.c18
-rw-r--r--hw/kdrive/vxworks/vxworks.c1
5 files changed, 18 insertions, 4 deletions
diff --git a/hw/kdrive/itsy/itsy.c b/hw/kdrive/itsy/itsy.c
index 4f2ac1cbb..48b56b7ff 100644
--- a/hw/kdrive/itsy/itsy.c
+++ b/hw/kdrive/itsy/itsy.c
@@ -306,6 +306,7 @@ KdOsFuncs ItsyOsFuncs = {
ItsyOsSpecialKey,
ItsyOsDisable,
ItsyOsFini,
+ 0
};
void
diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c
index dadcee11f..23ae50452 100644
--- a/hw/kdrive/linux/linux.c
+++ b/hw/kdrive/linux/linux.c
@@ -471,6 +471,7 @@ KdOsFuncs LinuxFuncs = {
LinuxSpecialKey,
LinuxDisable,
LinuxFini,
+ 0
};
void
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
diff --git a/hw/kdrive/vxworks/vxworks.c b/hw/kdrive/vxworks/vxworks.c
index 9bfc9e278..a40f7590f 100644
--- a/hw/kdrive/vxworks/vxworks.c
+++ b/hw/kdrive/vxworks/vxworks.c
@@ -59,6 +59,7 @@ KdOsFuncs VxWorksFuncs = {
VxWorksSpecialKey,
VxWorksDisable,
VxWorksFini,
+ 0
};
void