Jump to content
  • Advertisement
Sign in to follow this  
EbonySeraphim

DirectX Button Limit

This topic is 2640 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This seems like an end-user question, but as a developer, I'm seeking a developers explanation which is why I'm posing here:

I've recently gotten into flight sims and purchased a Thrustmaster Warthog. There are a lot of buttons and switches on the product that add up to 19 buttons on the joystick and 32 on the throttle (2 separate game pads in Windows). In it's native sim/game(DCS:A-10C) it works great because there's direct knowledge of the product I bought, but other sims don't have built in mappings for events such as the release of a specific button (usually switch put in the off or center position, or throttle from OFF to IDLE). This leaves me to attempt to use the Thrustmaster scripting tool which can virtualize a new device with button events generated on arbitrary input events. That is, a release of a physical button can be mapped to a press of a button in the virtual controller -- or even trigger a button hold, etc. Even though I can do this, I still need(ok...maybe want is the operative word) the original 32 buttons but TARGET claims DirectX is capped at 32 buttons, and so do the flight sim forums. This means, I have no where to map the new actions unless I force it to generate keyboard events which would get messy since the sim would have those mapped and I'd have to clobber them.

Being a developer and having written more than trivial code for joysticks, I was pretty sure this was false so I checked the DirectInput documentation. I noticed that DIJOYSTATE2 supports 128 buttons, and DIJOYSTATE supports 32. I can tell the joysticks I'm working with appear to be operating under the constraints of DIJOYSTATE, but the code I've written (since 2002-ish) has always used DIJOYSTATE2 and works on older devices just fine. It seems obvious that one was meant to support more elaborate controllers and DIJOYSTATE2 has been there since DirectInput8 so why is this still considered a limitation? Unless the game/software is older than DirectX8, support for 128 buttons has been there for a long time. Maybe I'm missing something.

tldr: Why does newer software still consider DirectInput joysticks to have a 32 button hard limit when DIJOYSTATE2 (part of the API) supports 128 buttons?

Share this post


Link to post
Share on other sites
Advertisement
Either I asked a really dumb question, or one that no one knows the answer to - a response indicating either one would be appreciated =)

I did further Googling and ran into a post on a Unity forum which said that Microsoft's HID interface limits the number of buttons to 32. Though it wouldn't limit joysticks that might actually use another interface (gameport?), for all intensive purposes, I'd accept that as a show stopper and a reason for hardware manufacturers and software implementers to consider it a hard limit. I'm not 100% sold on the post until I find more concrete information because it seems awfully short sighted so I'd like to see it written in some official document or find more secondary sources saying the same thing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!