From a7dbd0ca91b948f4d6ca4909e8f12e100abd3f2c Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Mon, 14 Feb 2011 14:10:04 -0600 Subject: [PATCH] input still works... trying to be as careful as I can here --- .../InputHandler/InputHandler_DirectInput.cpp | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/arch/InputHandler/InputHandler_DirectInput.cpp b/src/arch/InputHandler/InputHandler_DirectInput.cpp index 4da20f4e54..5824b1cd6a 100644 --- a/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -378,8 +378,8 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm ) } } break; - /* case device.MOUSE: + /* DIMOUSESTATE state; HRESULT hr = GetDeviceState(device.Device, sizeof(state), &state); @@ -400,9 +400,8 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm ) break; } } - + */ break; - */ } } @@ -565,18 +564,18 @@ const float POLL_FOR_JOYSTICK_CHANGES_EVERY_SECONDS = 0.25f; bool InputHandler_DInput::DevicesChanged() { - // GetNumJoysticksSlow() blocks DirectInput for a while even if called from a - // different thread, so we can't poll with it. - // GetNumHidDevices() is fast, but sometimes the DirectInput joysticks haven't updated by - // the time the HID registry value changes. - // So, poll using GetNumHidDevices(). When that changes, poll using GetNumJoysticksSlow() - // for a little while to give DirectInput time to catch up. On this XP machine, it takes - // 2-10 DirectInput polls (0.5-2.5 seconds) to catch a newly installed device after the - // registry value changes, and catches non-new plugged/unplugged devices on the first - // DirectInputPoll. - // Note that this "poll for N seconds" method will not work if the Add New Hardware wizard - // halts device installation to wait for a driver. Most of the joysticks people would - // want to use don't prompt for a driver though and the wizard adds them pretty quickly. + /* GetNumJoysticksSlow() blocks DirectInput for a while even if called from a + * different thread, so we can't poll with it. GetNumHidDevices() is fast, + * but sometimes the DirectInput joysticks haven't updated by the time the + * HID registry value changes. So, poll using GetNumHidDevices(). When that + * changes, poll using GetNumJoysticksSlow() for a little while to give + * DirectInput time to catch up. On this XP machine (which? -aj), it takes + * 2-10 DirectInput polls (0.5-2.5 seconds) to catch a newly installed device + * after the registry value changes, and catches non-new plugged/unplugged + * devices on the first DirectInputPoll. Note that this "poll for N seconds" + * method will not work if the Add New Hardware wizard halts device + * installation to wait for a driver. Most of the joysticks people would want + * to use don't prompt for a driver though, and the wizard adds them pretty quickly. */ int iOldNumHidDevices = m_iLastSeenNumHidDevices; m_iLastSeenNumHidDevices = GetNumHidDevices();