On Wed, Jul 05, 2006 at 08:00:38AM -0400, Robert Reif wrote:
The iteration is already done for you in IDirectInputWImpl_EnumDevices . You only need to probe for the specified device in joydev_enum_deviceW where id is the index of the device being probed ("/dev/input/event%d", id). Pass the id to joydev_have(). Look at the linux_input code to see how it is done.
i know. but the /dev/input/event nodes are not all joysticks. so i can not sinply add them and then stop with the first "no-existing" like joystick_linux does and this can also not be fixed by plug them in a different order into usb.
e.g. in my case i have the following devs (*=joystick, |=one hardware device) 0* TM Cougar Joystick 1| TM Cougar Fake Keyboard 2| TM Cougar Fake Mouse 3* BRD Speed 7 Pedals + Wheel 4 HH Keyboard
therefore i have changed the EnumDevices logic to the -1/0/1 scheme. but i can also leave that logic as it is and chane my code, that finds the joydevs (for now it is a 64-item array, where either this is a joystick or not) - i can also realloc that list for each joystick i find) and so make this work in the current 0/1 logic for EnumDevices.
thanks for looking into this - i will refine my patch. the 1-6/6 should not be applied until new version (i expect no changes for them).