#include "win.h"
#include "../../Xext/xf86miscproc.h"
CARD32 g_c32LastInputEventTime = 0;
Bool
LegalModifier (unsigned int uiKey, DevicePtr pDevice)
{
return TRUE;
}
void
ProcessInputEvents (void)
{
#if 0
ErrorF ("ProcessInputEvents\n");
#endif
mieqProcessInputEvents ();
miPointerUpdate ();
#if 0
ErrorF ("ProcessInputEvents - returning\n");
#endif
}
int
TimeSinceLastInputEvent ()
{
if (g_c32LastInputEventTime == 0)
g_c32LastInputEventTime = GetTickCount ();
return GetTickCount () - g_c32LastInputEventTime;
}
void
InitInput (int argc, char *argv[])
{
DeviceIntPtr pMouse, pKeyboard;
#if CYGDEBUG
ErrorF ("InitInput\n");
#endif
pMouse = AddInputDevice (winMouseProc, TRUE);
pKeyboard = AddInputDevice (winKeybdProc, TRUE);
RegisterPointerDevice (pMouse);
RegisterKeyboardDevice (pKeyboard);
miRegisterPointerDevice (screenInfo.screens[0], pMouse);
mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse);
winInitializeModeKeyStates ();
if (g_fdMessageQueue == WIN_FD_INVALID)
{
g_fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
if (g_fdMessageQueue == -1)
{
FatalError ("InitInput - Failed opening %s\n",
WIN_MSG_QUEUE_FNAME);
}
AddEnabledDevice (g_fdMessageQueue);
}
#if 0
{
MiscExtReturn ret;
pointer kbd;
#if 0
if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
return BadAlloc;
#else
kbd = MiscExtCreateStruct (MISC_KEYBOARD);
#endif
MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, 0);
MiscExtSetKbdValue(kbd, MISC_KBD_RATE, 0);
MiscExtSetKbdValue(kbd, MISC_KBD_DELAY, 0);
MiscExtSetKbdValue(kbd, MISC_KBD_SERVNUMLOCK, 0);
switch ((ret = MiscExtApply (kbd, MISC_KEYBOARD)))
{
case MISC_RET_SUCCESS: break;
case MISC_RET_BADVAL:
case MISC_RET_BADKBDTYPE:
default:
ErrorF ("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret);
}
}
#endif
#if CYGDEBUG
ErrorF ("InitInput - returning\n");
#endif
}
#ifdef XTESTEXT1
void
XTestGenerateEvent (int dev_type, int keycode, int keystate,
int mousex, int mousey)
{
ErrorF ("XTestGenerateEvent\n");
}
void
XTestGetPointerPos (short *fmousex, short *fmousey)
{
ErrorF ("XTestGetPointerPos\n");
}
void
XTestJumpPointer (int jx, int jy, int dev_type)
{
ErrorF ("XTestJumpPointer\n");
}
#endif