diff options
Diffstat (limited to 'xc/programs/Xserver/hw/vfb/InitInput.c')
-rw-r--r-- | xc/programs/Xserver/hw/vfb/InitInput.c | 94 |
1 files changed, 93 insertions, 1 deletions
diff --git a/xc/programs/Xserver/hw/vfb/InitInput.c b/xc/programs/Xserver/hw/vfb/InitInput.c index cf4d883fd..0fe50f180 100644 --- a/xc/programs/Xserver/hw/vfb/InitInput.c +++ b/xc/programs/Xserver/hw/vfb/InitInput.c @@ -22,7 +22,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.4 1998/10/04 09:38:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.5 2000/08/10 17:40:31 dawes Exp $ */ #include "X11/X.h" #define NEED_EVENTS @@ -44,6 +44,30 @@ from The Open Group. int xf86bpp = 8; #endif +#ifdef __CYGWIN__ +extern void init_mouse( ); +extern void init_keyboard( ); +extern void term_mouse( ); +extern void term_keyboard( ); +extern void get_WinMappings( char *pKeySyms, unsigned char *p_modMap ); + + +CARD32 lastEventTime = 0; + +int TimeSinceLastInputEvent() +{ + if (lastEventTime == 0) + lastEventTime = GetTimeInMillis(); + return GetTimeInMillis() - lastEventTime; +} + +void SetTimeSinceLastInputEvent() +{ + lastEventTime = GetTimeInMillis(); +} +#endif + + Bool LegalModifier(key, pDev) unsigned int key; @@ -260,6 +284,74 @@ GetLK201Mappings(pKeySyms, pModMap) #undef INDEX } +#ifdef __CYGWIN__ +static int +winKeybdProc(pDevice, onoff) + DeviceIntPtr pDevice; + int onoff; +{ + KeySymsRec keySyms; + CARD8 modMap[MAP_LENGTH]; + int i; + DevicePtr pDev = (DevicePtr)pDevice; + + switch (onoff) + { + case DEVICE_INIT: + get_WinMappings(&keySyms, modMap); + InitKeyboardDeviceStruct(pDev, &keySyms, modMap, + (BellProcPtr)NoopDDA, (KbdCtrlProcPtr)NoopDDA); + init_keyboard(); + break; + case DEVICE_ON: + pDev->on = TRUE; + break; + case DEVICE_OFF: + pDev->on = FALSE; + break; + case DEVICE_CLOSE: + term_keyboard(); + break; + } + return Success; +} + +static int +winMouseProc(pDevice, onoff) + DeviceIntPtr pDevice; + int onoff; +{ + BYTE map[4]; + DevicePtr pDev = (DevicePtr)pDevice; + + switch (onoff) + { + case DEVICE_INIT: + map[1] = 1; + map[2] = 2; + map[3] = 3; + InitPointerDeviceStruct(pDev, map, 3, miPointerGetMotionEvents, + (PtrCtrlProcPtr)NoopDDA, miPointerGetMotionBufferSize()); + init_mouse(); + break; + + case DEVICE_ON: + pDev->on = TRUE; + break; + + case DEVICE_OFF: + pDev->on = FALSE; + break; + + case DEVICE_CLOSE: + term_mouse(); + break; + } + return Success; +} +#endif /* __CYGWIN__ */ + + static int vfbKeybdProc(pDevice, onoff) DeviceIntPtr pDevice; |