diff --git a/code/nel/include/nel/3d/driver.h b/code/nel/include/nel/3d/driver.h index 8c7d0ef1c..cb6ec349c 100644 --- a/code/nel/include/nel/3d/driver.h +++ b/code/nel/include/nel/3d/driver.h @@ -866,10 +866,6 @@ public: /// x and y must be between 0.0 and 1.0 virtual void setMousePos(float x, float y) = 0; - /** Get the delay in ms for mouse double clicks. - */ - virtual uint getDoubleClickDelay(bool hardwareMouse) = 0; - /** If true, capture the mouse to force it to stay under the window. * NB : this has no effects if a low level mouse is used */ diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index 8af6091e3..9e385a2f7 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -35,9 +35,6 @@ namespace NLMISC { - struct IMouseDevice; - struct IKeyboardDevice; - struct IInputDeviceManager; class CLog; } diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 96937fa94..4da016135 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -1637,20 +1637,6 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r // Setup the event emitter, and try to retrieve a direct input interface _EventEmitter.addEmitter(we, true /*must delete*/); // the main emitter - // Try to get direct input - try - { - NLMISC::CDIEventEmitter *diee = NLMISC::CDIEventEmitter::create(GetModuleHandle(NULL), _HWnd, we); - if (diee) - { - _EventEmitter.addEmitter(diee, true); - } - } - catch(const EDirectInput &e) - { - nlinfo(e.what()); - } - // Init some variables _ForceDXTCCompression = false; _AnisotropicFilter = 0; @@ -2010,13 +1996,6 @@ bool CDriverD3D::swapBuffers() // todo hulud volatile //_DeviceInterface->SetStreamSource(0, _VolatileVertexBufferRAM[1]->VertexBuffer, 0, 12); - // Is direct input running ? - if (_EventEmitter.getNumEmitters() > 1) - { - // flush direct input messages if any - NLMISC::safe_cast(_EventEmitter.getEmitter(1))->poll(); - } - // End now if (!endScene()) { diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index 254b21871..8b8ac62df 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -1033,11 +1033,6 @@ public: // Change default scale for all cursors virtual void setCursorScale(float scale); - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive); - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable); - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager(); - virtual uint getDoubleClickDelay(bool hardwareMouse); - // Lights virtual uint getMaxLight () const; virtual void setLight (uint8 num, const CLight& light); diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp index dbfcd155a..f754b6357 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp @@ -463,121 +463,6 @@ bool CDriverD3D::isSystemCursorCaptured() return GetCapture() == _HWnd; } -// *************************************************************************** -NLMISC::IMouseDevice* CDriverD3D::enableLowLevelMouse(bool enable, bool exclusive) -{ - H_AUTO_D3D(CDriverD3D_enableLowLevelMouse); - - NLMISC::IMouseDevice *res = NULL; - - NLMISC::CDIEventEmitter *diee = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - if (enable) - { - try - { - if (diee) - res = diee->getMouseDevice(exclusive); - } - catch (const EDirectInput &) - { - } - } - else - { - if (diee) - diee->releaseMouse(); - } - - return res; -} - -// *************************************************************************** -NLMISC::IKeyboardDevice* CDriverD3D::enableLowLevelKeyboard(bool enable) -{ - H_AUTO_D3D(CDriverD3D_enableLowLevelKeyboard); - - NLMISC::IKeyboardDevice *res = NULL; - - NLMISC::CDIEventEmitter *diee = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - if (enable) - { - try - { - if (diee) - res = diee->getKeyboardDevice(); - } - catch (const EDirectInput &) - { - } - } - else - { - if (diee) - diee->releaseKeyboard(); - } - - return res; -} - -// *************************************************************************** -NLMISC::IInputDeviceManager* CDriverD3D::getLowLevelInputDeviceManager() -{ - H_AUTO_D3D(CDriverD3D_getLowLevelInputDeviceManager); - - NLMISC::IInputDeviceManager *res = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - res = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - return res; -} - -// *************************************************************************** -uint CDriverD3D::getDoubleClickDelay(bool hardwareMouse) -{ - H_AUTO_D3D(CDriverD3D_getDoubleClickDelay); - - uint res = 250; - - NLMISC::IMouseDevice *md = NULL; - - if (_EventEmitter.getNumEmitters() >= 2) - { - NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - if (diee->isMouseCreated()) - { - try - { - md = diee->getMouseDevice(hardwareMouse); - } - catch (const EDirectInput &) - { - // could not get device .. - } - } - } - - if (md) - { - res = md->getDoubleClickDelay(); - } - else - { - // try to read the good value from windows - res = ::GetDoubleClickTime(); - } - - return res; -} - bool CDriverD3D::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY) { return convertBitmapToIcon(bitmap, cursor, iconWidth, iconHeight, iconDepth, col, hotSpotX, hotSpotY, true); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index a6e3ad7b7..da047ad20 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -934,14 +934,6 @@ bool CDriverGL::swapBuffers() } #endif -#ifdef NL_OS_WINDOWS - if (_EventEmitter.getNumEmitters() > 1) // is direct input running ? - { - // flush direct input messages if any - NLMISC::safe_cast(_EventEmitter.getEmitter(1))->poll(); - } -#endif - if (!_WndActive) { if (_AGPVertexArrayRange) _AGPVertexArrayRange->updateLostBuffers(); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index 241b3bb95..ffefafdee 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -527,14 +527,6 @@ public: // Change default scale for all cursors virtual void setCursorScale(float scale); - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive); - - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable); - - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager(); - - virtual uint getDoubleClickDelay(bool hardwareMouse); - virtual void getWindowSize (uint32 &width, uint32 &height); virtual void getWindowPos (sint32 &x, sint32 &y); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp index 92b25baf4..cbd1bcd9a 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp @@ -664,149 +664,6 @@ bool CDriverGL::isSystemCursorCaptured() #endif } -// *************************************************************************** -NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive) -{ - H_AUTO_OGL(CDriverGL_enableLowLevelMouse); - - NLMISC::IMouseDevice *res = NULL; - -#ifdef NL_OS_WINDOWS - - NLMISC::CDIEventEmitter *diee = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - if (enable) - { - try - { - if (diee) - res = diee->getMouseDevice(exclusive); - } - catch (const EDirectInput &) - { - } - } - else - { - if (diee) - diee->releaseMouse(); - } - -#elif defined(NL_OS_MAC) -#elif defined (NL_OS_UNIX) -#endif - - return res; -} - -// *************************************************************************** -NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable) -{ - H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard); - - NLMISC::IKeyboardDevice *res = NULL; - -#ifdef NL_OS_WINDOWS - - NLMISC::CDIEventEmitter *diee = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - if (enable) - { - try - { - if (diee) - res = diee->getKeyboardDevice(); - } - catch (const EDirectInput &) - { - } - } - else - { - if (diee) - diee->releaseKeyboard(); - } - -#elif defined(NL_OS_MAC) -#elif defined (NL_OS_UNIX) -#endif - - return res; -} - -// *************************************************************************** -NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager() -{ - H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager); - - NLMISC::IInputDeviceManager *res = NULL; - -#ifdef NL_OS_WINDOWS - - if (_EventEmitter.getNumEmitters() > 1) - res = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - -#elif defined(NL_OS_MAC) -#elif defined (NL_OS_UNIX) -#endif - - return res; -} - -// *************************************************************************** -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(_EventEmitter.getEmitter(1)); - if (diee->isMouseCreated()) - { - try - { - md = diee->getMouseDevice(hardwareMouse); - } - catch (const EDirectInput &) - { - // could not get device .. - } - } - } - - if (md) - { - res = md->getDoubleClickDelay(); - } - else - { - // try to read the good value from windows - res = ::GetDoubleClickTime(); - } - -#elif defined(NL_OS_MAC) - // TODO: Missing Mac Implementation for getDoubleClickDelay -#elif defined (NL_OS_UNIX) - - // TODO for Linux - -#endif - - return res; -} - bool CDriverGL::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight) { #ifdef NL_OS_WINDOWS diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index e377554d0..03796206c 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -938,20 +938,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re // setup the event emitter, and try to retrieve a direct input interface _EventEmitter.addEmitter(we, true /*must delete*/); // the main emitter - /// try to get direct input - try - { - NLMISC::CDIEventEmitter *diee = NLMISC::CDIEventEmitter::create(GetModuleHandle(NULL), _win, we); - if (diee) - { - _EventEmitter.addEmitter(diee, true); - } - } - catch(const EDirectInput &e) - { - nlinfo(e.what()); - } - #elif defined(NL_OS_MAC) if (wnd == EmptyWindow) diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 695f87bf8..8eb1d68b9 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -165,7 +165,6 @@ using namespace std; // EXTERN // //////////// extern UDriver *Driver; -extern IMouseDevice *MouseDevice; extern UScene *Scene; extern UScene *SceneRoot; extern ULandscape *Landscape;