usb - How to help Windows or Windows Applications handle Composite Joysticks correctly? -


the context question windows 7, though i've tried on 10 well.

i've built 4-player composite joystick using arduino mega 2560. usb device composed of 4 hid joystick interface, each own endpoint. each joystick accompanied buttons shows correctly in device manager separate hid interface. identified vid/pid/mi_# triplet correctly, mi_# being interface index (mi_0, mi_1, etc). calibration sees each interface separate, inputs correctly corresponding each controller in enumerated order (ie: first 1 receives inputs joystick @ index 0). when dump descriptors, correct.

there 2 issues:

1) naming

windows reads interface string first interface. according descriptor dump, each interface should have own string, going "player 1" "player 4". windows 7 sees them "player 1". inspecting regedit, may because windows 7 has 1 oem name per joystick device, , gets 1 first interface. stuck behaviour, unless somehow resolution microsoft?

for reason, windows 10 calls them "arduino joystick". i'm not sure if because i'm using same test vid/pid combo got arduino joystick tutorial , windows picking name else has used device, or if concatenating manufacturer string interface type "joystick". i'm not sure why latter, if it's former i'd prefer block look-up somehow.

i'd resolve both, practically speaking i'm using windows 7 mostly.

2) mixed inputs

i've seen behaviour applications, unfortunately 1 of them steam, , others may due unity. manifests differently, i'm lead believe it's due there being no standard way dealing composite joysticks.

on steam, in big picture mode when try add/test controller, while detects 4 controllers (all player 4, might add), accepts inputs joy4 no matter of controllers choose. after saving config however, joysticks have same mappings applied. good, can use controller navigate big picture mode, i'm concerned it's symptomatic of other problems might seeing in other applications.

in "race sun", when manually configuring joystick controls (it says player 4 detected), interpret inputs single joystick coming multiple joysticks. usually, 2 of 4 directional inputs come joy1, while 2 other come joystick other 1 being used. eg: if i'm configuring joy2, it'll register inputs joy1 , joy3.

in "overcooked", allows single joystick register 4 different players. you'd hit particular button on controller want use register player, in case if hit button on joy1 4 times, 4 players registered. if start game this, end-up controlling 4 characters simultaneously 1 joystick. interesting, not intended usage, i'm sure.

both "race sun" , "overcooked" developed using unity, , understand unity's joystick management rather lacking. overcooked @ least designed handle multiple players though (it's couch co-op game), has more composite nature of controllers.

i should note other applications have no problems differentiating between joysticks. xbox360ce sees them separate, , emulation works on several steam games, single , multiplayer. overcooked still getting joysticks crossed though i'm using xbox360ce it.

the question i'm bringing stack overflow improve how applications handle joysticks? right i'm using generic windows game controller driver. theoretically should have been enough, issue #1 shows composite joysticks may not expected use case. driver development have hope of resolving issue applications mentioned above, don't see how device differ in identification. i'm hoping more experienced coding usb devices can offer insight.

for it's worth, arduino sketch , firmware can found here.

i have found solution "race sun" , "overcooked".

"race sun" may have expected joystick provide axis ranges 0 maximum (eg: 32767). had firmware set going -255 +255. while other applications handle fine, "race sun" may expect more common 0-x behaviour (this range logitech joystick of mine provides). after changing this, able configure , play correctly. i've updated github project; link in original question.

the problem "overcooked" caused badly configured or corrupted xbox360ce installation. somewhere in tinkering emulator must have screwed up, messed games working. solved wiping files, including content in programdata/x360ce, , re-downloading , redoing controllers. games seem behaving correctly.

this still leaves problem steam. reason steam doesn't remember joystick configuration reboot reboot. time-being i've decided put default joystick behaviour, sort 1 out eventually, too.


Comments