|
|
|
@ -1570,26 +1570,32 @@ NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive
|
|
|
|
|
{
|
|
|
|
|
H_AUTO_OGL(CDriverGL_enableLowLevelMouse)
|
|
|
|
|
|
|
|
|
|
NLMISC::IMouseDevice *res = NULL;
|
|
|
|
|
|
|
|
|
|
#ifdef NL_OS_WINDOWS
|
|
|
|
|
if (_EventEmitter.getNumEmitters() < 2) return NULL;
|
|
|
|
|
NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast<CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
|
|
|
|
|
|
|
|
|
NLMISC::CDIEventEmitter *diee = NULL;
|
|
|
|
|
|
|
|
|
|
if (_EventEmitter.getNumEmitters() > 1)
|
|
|
|
|
diee = NLMISC::safe_cast<CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
|
|
|
|
|
|
|
|
|
if (enable)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
NLMISC::IMouseDevice *md = diee->getMouseDevice(exclusive);
|
|
|
|
|
return md;
|
|
|
|
|
if (diee)
|
|
|
|
|
res = diee->getMouseDevice(exclusive);
|
|
|
|
|
}
|
|
|
|
|
catch (EDirectInput &)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (diee)
|
|
|
|
|
diee->releaseMouse();
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
|
|
|
|
|
# warning "OpenGL Driver: Missing Mac Implementation"
|
|
|
|
|
nlwarning("OpenGL Driver: Missing Mac Implementation");
|
|
|
|
@ -1597,33 +1603,41 @@ NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive
|
|
|
|
|
#elif defined (NL_OS_UNIX)
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard)
|
|
|
|
|
|
|
|
|
|
NLMISC::IKeyboardDevice *res = NULL;
|
|
|
|
|
|
|
|
|
|
#ifdef NL_OS_WINDOWS
|
|
|
|
|
if (_EventEmitter.getNumEmitters() < 2) return NULL;
|
|
|
|
|
NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
|
|
|
|
|
|
|
|
|
NLMISC::CDIEventEmitter *diee = NULL;
|
|
|
|
|
|
|
|
|
|
if (_EventEmitter.getNumEmitters() > 1)
|
|
|
|
|
diee = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
|
|
|
|
|
|
|
|
|
if (enable)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
NLMISC::IKeyboardDevice *md = diee->getKeyboardDevice();
|
|
|
|
|
return md;
|
|
|
|
|
if (diee)
|
|
|
|
|
res = diee->getKeyboardDevice();
|
|
|
|
|
}
|
|
|
|
|
catch (EDirectInput &)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (diee)
|
|
|
|
|
diee->releaseKeyboard();
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
|
|
|
|
|
# warning "OpenGL Driver: Missing Mac Implementation"
|
|
|
|
|
nlwarning("OpenGL Driver: Missing Mac Implementation");
|
|
|
|
@ -1631,17 +1645,22 @@ NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable)
|
|
|
|
|
#elif defined (NL_OS_UNIX)
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager()
|
|
|
|
|
{
|
|
|
|
|
H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager)
|
|
|
|
|
|
|
|
|
|
NLMISC::IInputDeviceManager *res = NULL;
|
|
|
|
|
|
|
|
|
|
#ifdef NL_OS_WINDOWS
|
|
|
|
|
if (_EventEmitter.getNumEmitters() < 2) return NULL;
|
|
|
|
|
NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
|
|
|
|
return diee;
|
|
|
|
|
|
|
|
|
|
if (_EventEmitter.getNumEmitters() > 1)
|
|
|
|
|
res = NLMISC::safe_cast<NLMISC::CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
|
|
|
|
|
|
|
|
|
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
|
|
|
|
|
# warning "OpenGL Driver: Missing Mac Implementation"
|
|
|
|
|
nlwarning("OpenGL Driver: Missing Mac Implementation");
|
|
|
|
@ -1649,7 +1668,8 @@ NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager()
|
|
|
|
|
#elif defined (NL_OS_UNIX)
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
@ -1657,8 +1677,12 @@ uint CDriverGL::getDoubleClickDelay(bool hardwareMouse)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO_OGL(CDriverGL_getDoubleClickDelay)
|
|
|
|
|
|
|
|
|
|
uint res = 250;
|
|
|
|
|
|
|
|
|
|
#ifdef NL_OS_WINDOWS
|
|
|
|
|
|
|
|
|
|
NLMISC::IMouseDevice *md = NULL;
|
|
|
|
|
|
|
|
|
|
if (_EventEmitter.getNumEmitters() >= 2)
|
|
|
|
|
{
|
|
|
|
|
NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast<CDIEventEmitter *>(_EventEmitter.getEmitter(1));
|
|
|
|
@ -1674,20 +1698,28 @@ uint CDriverGL::getDoubleClickDelay(bool hardwareMouse)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (md)
|
|
|
|
|
{
|
|
|
|
|
return md->getDoubleClickDelay();
|
|
|
|
|
res = md->getDoubleClickDelay();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// try to read the good value from windows
|
|
|
|
|
return ::GetDoubleClickTime();
|
|
|
|
|
res = ::GetDoubleClickTime();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
|
|
|
|
|
# warning "OpenGL Driver: Missing Mac Implementation"
|
|
|
|
|
nlwarning("OpenGL Driver: Missing Mac Implementation");
|
|
|
|
|
|
|
|
|
|
#elif defined (NL_OS_UNIX)
|
|
|
|
|
// TODO for Linux FIXME: FAKE FIX
|
|
|
|
|
return 250;
|
|
|
|
|
|
|
|
|
|
// TODO for Linux
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|