Example #1
0
/* See Porting Layer Definition - p. 17 */
void
InitInput (int argc, char *argv[])
{
  DeviceIntPtr		pMouse, pKeyboard;

#if CYGDEBUG
  winDebug ("InitInput\n");
#endif

#ifdef XWIN_CLIPBOARD
  /*
   * Wrap some functions at every generation of the server.
   */
  if (InitialVector[2] != winProcEstablishConnection)
    {
      winProcEstablishConnectionOrig = InitialVector[2];
      InitialVector[2] = winProcEstablishConnection;
    }
  if (g_fXdmcpEnabled
      && ProcVector[X_QueryTree] != winProcQueryTree)
    {
      winProcQueryTreeOrig = ProcVector[X_QueryTree];
      ProcVector[X_QueryTree] = winProcQueryTree;
    }
#endif

  pMouse = AddInputDevice (winMouseProc, TRUE);
  pKeyboard = AddInputDevice (winKeybdProc, TRUE);
  
  RegisterPointerDevice (pMouse);
  RegisterKeyboardDevice (pKeyboard);

  miRegisterPointerDevice (screenInfo.screens[0], pMouse);
  mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse);

  /* Initialize the mode key states */
  winInitializeModeKeyStates ();

#ifdef HAS_DEVWINDOWS
  /* Only open the windows message queue device once */
  if (g_fdMessageQueue == WIN_FD_INVALID)
    {
      /* Open a file descriptor for the Windows message queue */
      g_fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
      
      if (g_fdMessageQueue == -1)
	{
	  FatalError ("InitInput - Failed opening %s\n",
		      WIN_MSG_QUEUE_FNAME);
	}

      /* Add the message queue as a device to wait for in WaitForSomething */
      AddEnabledDevice (g_fdMessageQueue);
    }
#endif

#if CYGDEBUG
  winDebug ("InitInput - returning\n");
#endif
}
Example #2
0
File: InitInput.c Project: aosm/X11
void
InitInput(int argc, char *argv[])
{
    DeviceIntPtr p, k;
    p = AddInputDevice(vfbMouseProc, TRUE);
    k = AddInputDevice(vfbKeybdProc, TRUE);
    RegisterPointerDevice(p);
    RegisterKeyboardDevice(k);
    miRegisterPointerDevice(screenInfo.screens[0], p);
    (void)mieqInit ((DevicePtr) k, (DevicePtr) p);
}
void
InitInput(
     int       argc,
     char **argv)
{
    DeviceIntPtr ptr, kbd;

    ptr = AddInputDevice((DeviceProc)PointerProc, TRUE);
    kbd = AddInputDevice((DeviceProc)KeyboardProc, TRUE);
    RegisterPointerDevice(ptr);
    RegisterKeyboardDevice(kbd);
    return;
}
void
InitInput(int argc, char *argv[])
{
    DeviceIntPtr p, k;
    Atom xiclass;

    p = AddInputDevice(serverClient, vfbMouseProc, TRUE);
    k = AddInputDevice(serverClient, vfbKeybdProc, TRUE);
    xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE);
    AssignTypeAndName(p, xiclass, "Xvfb mouse");
    xiclass = MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE);
    AssignTypeAndName(k, xiclass, "Xvfb keyboard");
    (void) mieqInit();
}
Example #5
0
bool CLinuxInput::Init()
{
	m_pLog->Log("Initializing LinuxInput/SDL");
	
	uint32 flags = SDL_INIT_EVENTS | SDL_INIT_JOYSTICK;
#if defined(SDL_USE_HAPTIC_FEEDBACK)
	flags |= SDL_INIT_HAPTIC;
#endif

	if (SDL_InitSubSystem(flags) != 0)
	{
		m_pLog->Log("Error: Initializing SDL Subsystems:%s", SDL_GetError());
		return false;
	}
	
	if (!CBaseInput::Init())
	{
		m_pLog->Log("Error: CBaseInput::Init failed");
		return false;
	}
	CSDLMouse* pMouse = new CSDLMouse(*this);
	if (AddInputDevice(pMouse))
	{
		m_pMouse = pMouse;
	}
	else
	{
		m_pLog->Log("Error: Initializing SDL Mouse");
		delete pMouse;
		return false;
	}
	CSDLKeyboard* pKeyboard = new CSDLKeyboard(*this);
	if (!AddInputDevice(pKeyboard))
	{
		delete pKeyboard;
		m_pLog->Log("Error: Initializing SDL Keyboard");
		return false;
	}
	
	m_pPadManager = new CSDLPadManager(*this);
	if (!m_pPadManager->Init())
	{
		delete m_pPadManager;
		m_pLog->Log("Error: Initializing SDL GamePad Manager");
		return false;
	}
	
	return true;
}
Example #6
0
//-----------------------------------------------------------------------------
// Name: InitDirectInput()
// Desc: Initialize the DirectInput variables.
//-----------------------------------------------------------------------------
HRESULT SrInputManager::Init( HWND hDlg )
{
	HRESULT hr;

	m_hWnd = hDlg;

	if( FAILED( hr = DirectInput8Create( GetModuleHandle( NULL ), DIRECTINPUT_VERSION,
		IID_IDirectInput8, ( VOID** )&m_pDI, NULL ) ) )
		return hr;

	if (!AddInputDevice(new Keyboard(this))) return false;
	if (!AddInputDevice(new Mouse(this))) return false;

	//ClearKeyState();

	return S_OK;
}
Example #7
0
void
InitInput(int argc, char *argv[])
{
  xnestPointerDevice = AddInputDevice(xnestPointerProc, TRUE);
  xnestKeyboardDevice = AddInputDevice(xnestKeyboardProc, TRUE);

  if (!xnestEvents)
      xnestEvents = (xEvent *) xcalloc(sizeof(xEvent), GetMaximumEventsNum());
  if (!xnestEvents)
      FatalError("couldn't allocate room for events\n");

  RegisterPointerDevice(xnestPointerDevice);
  RegisterKeyboardDevice(xnestKeyboardDevice);

  mieqInit();

  AddEnabledDevice(XConnectionNumber(xnestDisplay));

  RegisterBlockAndWakeupHandlers(xnestBlockHandler, xnestWakeupHandler, NULL);
}
Example #8
0
/* See Porting Layer Definition - p. 17 */
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);

  /* Initialize the mode key states */
  winInitializeModeKeyStates ();

  /* Only open the windows message queue device once */
  if (g_fdMessageQueue == WIN_FD_INVALID)
    {
      /* Open a file descriptor for the Windows message queue */
      g_fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
      
      if (g_fdMessageQueue == -1)
	{
	  FatalError ("InitInput - Failed opening %s\n",
		      WIN_MSG_QUEUE_FNAME);
	}

      /* Add the message queue as a device to wait for in WaitForSomething */
      AddEnabledDevice (g_fdMessageQueue);
    }

#if CYGDEBUG
  ErrorF ("InitInput - returning\n");
#endif
}
Example #9
0
File: InitInput.c Project: aosm/X11
/* See Porting Layer Definition - p. 17 */
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);

  /* Initialize the mode key states */
  winInitializeModeKeyStates ();

  /* Only open the windows message queue device once */
  if (g_fdMessageQueue == WIN_FD_INVALID)
    {
      /* Open a file descriptor for the Windows message queue */
      g_fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
      
      if (g_fdMessageQueue == -1)
	{
	  FatalError ("InitInput - Failed opening %s\n",
		      WIN_MSG_QUEUE_FNAME);
	}

      /* Add the message queue as a device to wait for in WaitForSomething */
      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
}