DirectInput problem with torque
by Jim Rowley · in Torque Game Engine · 06/24/2003 (10:29 am) · 0 replies
I've run into an issue with torque that has given me problems in all the demos and I think it was even a problem in Tribes2.
When I run torque in fullscreen mode, the gui checkboxes and trees don't function properly.
I found that the onMouseDown event is being processed twice for each single mouseclick which is effectively negating the checkbox and tree toggles.
After further investigations, I've noticed that DirectInput8 is enumerating my mouse twice (its a USB mouse). DirectInput is enumerating it as a normal mouse, and also again as a HID compliant device. This causes a single device to send multiple events to the game it seems.
My workaround was to insert a few lines into winDInputDevice.cc as follows:
...in DInputDevice::create() ...
If it is common for DirectInput to enumerate HID compliant USB mice this way, then torque has a bug here which should be addressed...
If it is not correct for DirectInput to enumerate my system USB mouse that way, would someone please let me know so that I will research my problem further?
Thanks.
When I run torque in fullscreen mode, the gui checkboxes and trees don't function properly.
I found that the onMouseDown event is being processed twice for each single mouseclick which is effectively negating the checkbox and tree toggles.
After further investigations, I've noticed that DirectInput8 is enumerating my mouse twice (its a USB mouse). DirectInput is enumerating it as a normal mouse, and also again as a HID compliant device. This causes a single device to send multiple events to the game it seems.
My workaround was to insert a few lines into winDInputDevice.cc as follows:
...in DInputDevice::create() ...
Quote:
#ifdef LOG_INPUT
Input::log( "%s detected, created as %s (%s).\n", mDeviceInstance.tszProductName, mName, ( isPolled () ? "polled" : "asynchronous" ) );
#endif
if (GET_DIDEVICE_TYPE(mDeviceCaps.dwDevType) == DI8DEVTYPE_MOUSE && mDeviceCaps.dwFlags & DIDC_EMULATED)
return false; // JGR - Discard emulated mouse devices: don't want two event calls for 1 mouse
if ( enumerateObjects() )
{
...
If it is common for DirectInput to enumerate HID compliant USB mice this way, then torque has a bug here which should be addressed...
If it is not correct for DirectInput to enumerate my system USB mouse that way, would someone please let me know so that I will research my problem further?
Thanks.