summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xwin/InitInput.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xwin/InitInput.c')
-rw-r--r--xc/programs/Xserver/hw/xwin/InitInput.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/xc/programs/Xserver/hw/xwin/InitInput.c b/xc/programs/Xserver/hw/xwin/InitInput.c
index 4d008b272..355315f86 100644
--- a/xc/programs/Xserver/hw/xwin/InitInput.c
+++ b/xc/programs/Xserver/hw/xwin/InitInput.c
@@ -22,17 +22,20 @@
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.3 2001/04/18 17:14:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.4 2001/05/02 00:45:26 alanh Exp $ */
#include "win.h"
-/* Called from dix/devices.c */
-/* All of our keys generate up and down transition notifications,
- so all of our keys can be used as modifiers.
+CARD32 g_c32LastInputEventTime = 0;
- An example of a modifier is mapping the A key to the Control key.
- A has to be a legal modifier. I think.
-*/
+/* Called from dix/devices.c */
+/*
+ * All of our keys generate up and down transition notifications,
+ * so all of our keys can be used as modifiers.
+ *
+ * An example of a modifier is mapping the A key to the Control key.
+ * A has to be a legal modifier. I think.
+ */
Bool
LegalModifier (unsigned int uiKey, DevicePtr pDevice)
{
@@ -48,6 +51,14 @@ ProcessInputEvents (void)
miPointerUpdate ();
}
+int
+TimeSinceLastInputEvent ()
+{
+ if (g_c32LastInputEventTime == 0)
+ g_c32LastInputEventTime = GetTickCount ();
+ return GetTickCount () - g_c32LastInputEventTime;
+}
+
/* See Porting Layer Definition - p. 17 */
void
InitInput (int argc, char *argv[])