Search Unity

How do I map joystick buttons beyond 20 and axes beyond 8?

Discussion in 'Editor & General Support' started by Batman187, Feb 21, 2012.

  1. Batman187

    Batman187

    Joined:
    May 25, 2009
    Posts:
    11
    Hello,

    I am using a Saitek x52 Pro joystick, which is without a doubt one of the best joysticks ever devised. It has a ton of great buttons and axes. The problem is Unity only exposes 20 buttons and 8 axes in the Input Manager. This means I can't map all of the controls on this joystick. As it is right now, I can't detect input from any of the three hat switches.

    Is there any work-around available to map those extra inputs? I have done a lot of searching around on the forums and documentation and from what I can tell, I'm screwed. At least in this version of Unity. It seems like it would be an easy fix for the Unity Devs to open up a much larger number to accommodate the more advanced joysticks like this one.

    Here are related posts and documentation that lead me to believe there is no solution currently available. Please correct me if I am wrong!

    Script reference for KeyCode
    The list of supported joystick buttons goes from 0 to 19.
    What if the button/axis you want is not on this list?

    Input Manager documentation
    In the Input Manager when you click on Axis the popup menu lists Axes X, Y, and 3rd through 8th.
    What do I do if there are axes on my joystick that don't show up on this list?

    Looks like guavaman is running into related issues in his post here:
    Joystick detection and direct axis detection
    I want to echo his frustration with the Input Manager.
    I share these same sentiments.

    If anyone knows of solutions to these problems I would greatly appreciate hearing about them.
     
  2. tamberlain

    tamberlain

    Joined:
    Jun 16, 2013
    Posts:
    20
    I have the same issue. I'm developing a flight sim / space sim and I expect my customers will be using modern joysticks. All the serious joysticks now have 20+ buttons (counting all the hats, modifiers, two position toggle switches, dual position fire buttons etc). This limitation is a serious problem for me and I'm having to go to extremes such as writing my own joystick input device handler to access the raw device driver I/O because Unity is utterly lacking.