Search Unity

Rewired - Advanced Input for Unity

Discussion in 'Assets and Asset Store' started by guavaman, Sep 25, 2014.

  1. IceBeamGames

    IceBeamGames

    Joined:
    Feb 9, 2014
    Posts:
    121
    So, running that second debug scene on the Xbox it still returns the 1.176408E-08 value when the input has no value. (See attached screenshot) I can debug this further if it helps?

    I just meant, if there was a quick "converting to rewired" section, it might be worth noting that you don't need to manually code any button behaviour, as Rewired handles that...
     

    Attached Files:

  2. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Thanks for the picture. It does help.

    I noticed that the value is returned for a number of frames consecutively for Player 1 but not Player 2. That is interesting and odd... Does this only happen after you have pressed the trigger once?

    If you press a button that makes another Action log that causes the Charge axis entries to scroll off the log, does it immediately come right back?

    I need to know if the controller elements themselves have this tiny value stored in them. I modified the ShowAllControllerElements.cs file to print out the entire floating point value in the joystick elements instead of truncating it to 3 decimal places. This will tell me if a non-zero value is being stored in one of the L/R joystick axes. I've uploaded it here and you can replace the existing one in RewiredDebug. Thanks for the help in figuring out what's going on here!
     

    Attached Files:

    Last edited: Sep 8, 2016
  3. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Howso? UnityEngine.Input can't conflict with Rewired input. If it could, there would be no way to prevent it because Unity input is always active and cannot be disabled. If you're calling Input.GetButton/Axis, of course that's from Unity (unless you're using Unity Input Override). If you're calling player.GetButton/Axis, that's from Rewired. If you've chosen Unity as the primary input source or have enabled Disable Native Input, that would get the underlying controller input from UnityEngine.Input, but there still wouldn't be any conflicts.
     
  4. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,190
    By conflicting, I meant I had some code that was calling UnityEngine.Input explicitly which was counteracting some of the input I was using player.GetButton() to achieve, so it appeared as the scene was running that the input mapping on the controller was not working. Once, I removed the Unity explicit input the controls ran fine.
     
  5. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Ahh, okay. Thanks for the clarification!
     
  6. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,462
    I just noticed we are Rewired 1.0.0.101 already. I guess I missed the original notification for that version.
     
  7. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    I don't think I announced that one because it was another minor update.

    Please read Updating Rewired before updating.

    1.0.0.101:

    Changes:
    - OSX Native: Handled exception caused by using old version of 360Controller driver with Xbox One Controller and calling Joystick.SetVibration. (Documented minimum supported 360Controller version is 0.16 for vibration support on Xbox One Controller.)

    1.0.0.100:

    Changes:
    - Made changes to allow Rewired to work in the Linux Unity editor.
    - Added workarounds for UDev issues on Slackware Linux.

    Bug Fixes:
    - Fixed incorrect Right Stick Button mapping in Dual Analog Gamepad Template for Xiaomi Wireless Game Controller.
     
  8. IceBeamGames

    IceBeamGames

    Joined:
    Feb 9, 2014
    Posts:
    121
    So, yeah, non-zero values are being store in the sticks and L/R joystick axis.

    As a note, that second pad isn't a pad. its the xbox one manager tool which connects a fake joystick for testing purposes...
     

    Attached Files:

  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Thanks for testing and posting this.

    This is absolutely extraordinary... Based on exhaustively going over all code within the routine and doing trial and error testing in Windows, I can say with certainty that the only way possible for this to be happening is for the code behind Mathf.Approximately(value, zero) where value == 0.0f and zero == 0.0f to be returning false on Xbox One.

    If you look at the calibrated and raw axis values in the screenshot you posted:
    Calibrated value: 1.176408E-08
    Raw value: 0

    The calibrated value is calculated every frame from the raw value based on the calibration map. The very first piece of code in the function that calculates the calibrated value from the raw value is an approximate zero check. If it fails that check, the function will return 0.0f as should be happening. The only way I can reproduce this on Windows is to comment out the approximately zero check, then suddenly I get the exact same result you're getting on Xbox One: 1.176408E-08

    This is the first time I have ever seen basic math differ on two different Unity build platforms. I'm going to have to guess it's some kind of obscure mono or AOT compiler bug. I have seen many dozens of other cross-platform bugs and inconsistencies, but this one takes the cake.
     
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Last edited: Sep 13, 2016
  11. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    78
    Hello,I need joystick 20,21,22... but unity joystick just support between 0 -19, can I use your package for joystick 20,21,22......?If your package can do it,May you tell me the step of setting?
     
  12. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    The number of joysticks supported varies by the platform and chosen input source. Please download and try the Rewired demo to see if it does what you need. The documentation shows you how to set things up.
     
  13. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    78
    Thank U guavaman!But the doc is so long,can you tell me the step directly?
     
  14. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,462
    Are you running on the Windows PC platform?
     
  15. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    78
    YES!
     
  16. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,462
  17. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    78
  18. AlexThunderLotus

    AlexThunderLotus

    Joined:
    Jun 15, 2015
    Posts:
    11
    Hi,

    We had a Linux user who's controller wasn't working properly (wireless xbox 360). Upon investigating I found the controller name was "Xbox 360 Wireless Receiver for Windows" and in the default config file Rewired was looking for "Xbox 360 Wireless Receiver". Upon adding "Xbox 360 Wireless Receiver for Windows" as a system name, it worked for the user.

    Perhaps this is already a known issue but I figured you could use the information.
     
  19. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,462
    That is very interesting. Was this an actual Microsoft XBOX 360 controller or a third party controller? What distro and version of Linux was being used?
     
  20. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,462
    A custom wheel. That is very interesting controller. How many axis and how many buttons? Does this show up as a normal USB game controller under Windows control panel?

    Many of the flight controllers have 30 button and 3 axis so in theory it should be able to handle it. You should try out the Rewired trial version and see if it can handle your specific device.
     
  21. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    A custom wheel will only work via runtime user mapping. Open the Control Mapper example scene and see if all the buttons can be mapped using Control Mapper.
     
  22. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Thanks for the information!

    The deal with Linux is that not all distros are equal. One distro comes with one driver and another a completely different driver. Users can also install their own. Drivers can and do change controller names and mappings. Rewired only officially supports Ubuntu, as does Unity.

    The very first product name in the definition for Linux Native ".*xbox[ ]*360.*" will match both of the above strings so adding the explicit "Xbox 360 Wireless Receiver for Windows" system name should not make any difference. (And yes, the regex match is case insensitive.)
     
    Last edited: Sep 14, 2016
  23. Nifflas

    Nifflas

    Joined:
    Jun 13, 2013
    Posts:
    113
    Following one of the how-tos, I display the button/axis of an action using ActionElementMap.elementIdentifierName

    This thing will print out things like Left Stick Y +, or D-Pad Up. But, is there a way that from the ActionElementMap instance just get "Left Stick" without the Y +, or D Pad without the direction (that is neater than just string manipulation)?

    One reason where this would be helpful is when I automatically print out instructions. Let's say I have four slots assigned in a cross in my UI. If the user has mapped four general buttons on the controller to the slots, I just want to print all buttons out in the instructions. However, if the D Pad directions are assigned to these four slots, I'd like to be able to detect that simply printing out "D Pad" would be sufficient.

    If a direction of a stick is assigned as a button action (for example, entering a door by pressing the left stick upwards), I just want to tell which stick it is and let the user figure out the direction. I solved this through dirty string manipulation, but it has definitely worked better during playtesting than writing stuff like Y + which the players didn't understand, resulting in them trying to press the stick and the Y button, as well as wonder which button on the controller that is the + button.

    It'd be really nice to get the element name as a string and the direction as an enum. Then I could hint at the direction graphically.
     
    Last edited: Sep 15, 2016
  24. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    In this How To, it shows how to display a glyph for a joystick element customized for each controller. It also supports different glyphs for different axis directions. This information is built from the information in ActionElementMap. ActionElementMap.elementIdentifierName is simply a convienience shortcut that takes the element name from Joystick.ButtonElementIdentifiers and Joystick.AxisElementIdentifiers and appends a +/- if its a split axis mapping. You can rebuild this information from the mapping data. The properties of the ActionElementMap contain necessary information -- whether an axis or a button is mapped, the axis range, whether its inverted, etc.

    The one thing you cannot do is get "Left Stick" from the Action Element Map. "Left Stick X" and "Left Stick Y" are the element identifiers, one for each axis. Sticks in Rewired cannot be mapped to Actions -- only the individual Axes can. A "Stick" in Rewired is an Axis2D, which just point to two member Axes and only exist for the purpose of applying a radial dead zone. You could work backwards to find this information from the Axis2D in the Joystick however using the xAxis and yAxis properties and the Joystick.Axes.

    This isn't possible because there is no such thing as a D-Pad structure in Rewired. The only thing that exists are the individual element identifiers -- D-Pad Up, D-Pad Right, D-Pad Down, D-Pad Left.
     
    Last edited: Sep 16, 2016
  25. GrumpyBear33

    GrumpyBear33

    Joined:
    Jan 25, 2014
    Posts:
    7
    Hey!

    I'm running into some trouble and I figure I'd ask people in here!

    I'm trying to use the Control Mapper to put 4 players on the keyboard.

    The thing is, if I chose any other Keyboard Map other than the Default one, it doesn't work.

    i've create 4 keyboard maps for every player, then assign that to each player in the "players" tab.

    Then inside the control mapper, the keys won't show up for players that don't use the "Default" map. It kinda works (it uses the right keys when playing the game, it's just I can't remap them. All the fields are empty and when I try re-assigning them it says it already exists, then I remap but it just removed it from the other Keyboard map and assigned it to... nothing?

    Start enabled is checked and Joysticks work great.

    Any ideas?
     
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Control Mapper - Inspector Options: Map Categories and Actions



    The only Actions that will show up in Control Mapper are the ones you define to show up here. There are several Action List Modes to determine exactly which Actions you want to display to the user.
     
  27. GrumpyBear33

    GrumpyBear33

    Joined:
    Jan 25, 2014
    Posts:
    7
    Hi thanks for the reply. I already have those set up.

    Still they won't show up when I switch between Players.

    Here are some picks of my setup. Am I missing something?


    All the keyboard maps are defined and assigned to each Player. And only the one for Player1 (Default) shows anything and works (assigning keys to Player 2 to 4 won't actually change their controls scheme)

    EDIT: There is only one controller plugged-in at the moment, but if I plug another one it correctly shows up in Player 2 to 4. Just to clarify. The issue is only with trying to map 4 players on the same keyboard.
     

    Attached Files:

  28. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Hi,

    The way you have it set up is incorrect.

    You should be using Layouts for the different Players if you want to use Control Mapper, not separate categories.

    The way Control Mapper works is that you first have to select the current Player from the list of Players at the top. Then, for each Player, if you have multiple Categories set up in the inspector, it will list the Actions you choose to list for each Category. (If you have only one category set up, it will not have any buttons up top.) When you click one of those Category buttons, all mappings that you create will be made on the first Controller Map found in that Player in that Category (or it will create a new one if none exist).

    The design allows you to have multiple mapping categories for each Player. For example, if you have the categories Game and Menu, those categories will be mappable for each of the 4 Players individually. You first select the active Player, then you select the Category you wish to map for that Player.

    The way you have it set up, I can't tell if that list of Player 1-4 at the top is the Player selection or the Category selection. You have chosen to hide one or the other. If it's the Player selection, when you select a Player, it should then give the user the option to map your Map Categories, also Player 1-4. That would mean for each Player selected, you'd have 4 Map Categories of mappable Actions -- Player 1-4. That's obviously not what you're intending to do, but even though you've hidden the list, that's exactly what's happening still. It's showing you the Action list for the 1st Category -- Player 1 -- even when you select Player 2. Now it's showing Player 2, and giving you the option to edit his mappings for maps in the Category Player 1. Player 2 has no maps for the Category Player 1, so it created a new blank Controller Map for the Category Player 1, and so on.

    The inspector setting for Map Categories is not per Player -- it applies to all Players. (Notice there is no Player selection on the Map Category item in the inspector.) Unfortunately, Control Mapper does not have the capability of setting different Map Category or Action lists on a per-Player basis.

    If you look at the example included with Rewired, you will see a proper setup for multiple Players.

    Player 1-4
    Each has maps defined for several Map Categories
    For keyboard, Layouts Player 1-4 are used and maps are assigned to Players in the same categories, but using a different Layout for each.

    Control Mapper has a setting for Default Layout to be used, but it's only a suggestion as it will use whatever Controller Maps are found in the chosen Category preferring the chosen Default Layout, but will use the first Controller Map in the correct Category it finds even if the Layout does not match. This is how you can have 4 Players, each with Keyboard Maps in different Layouts.

    This is difficult to explain in words, but if you look how the Controller Maps are set up in the Rewired Input Manager in the example Rewired comes with I think you will understand.
     
    Last edited: Sep 20, 2016
  29. GrumpyBear33

    GrumpyBear33

    Joined:
    Jan 25, 2014
    Posts:
    7
    Ah! Thanks for the reply. It explains a lot.

    The top selection is indeed the Player selection.

    That is what I was trying to do but went at it the wrong way. It does work when I assign all the same
    Map Category / Action list.

    What I needed to use were Layouts and not different Maps!

    Thanks for your time!
     
    guavaman likes this.
  30. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Rewired 1.0.0.102 is now available on the Unity Asset Store!

    1.0.0.102:

    Changes
    - Added workaround for precision error on Xbox One platform when comparing if values are approximately equal.

    New Controller Definitions:
    - Added 8Bitdo SNES30 (Wired) because of firmware changes.

    Modified Controller Definitions:
    - 8Bitdo NES30 (Mode 1): Android Fallback, Linux Fallback: Changed D-Pad mappings to use axes instead of keys based on breaking changes in latest firmware version.
    - 8Bitdo NES30 (Mode 1): Raw Input, Windows UWP, OSX Native, OSX Fallback: Added mapping now that changes in latest firmware version work with this mode.
    - 8Bitdo NES30 (Mode 1): Linux Native: Added variant for new firmware changes.
    - 8Bitdo SNES30 (Mode 1): Android Fallback, Linux Fallback: Changed D-Pad mappings to use axes instead of keys based on breaking changes in latest firmware version.
    - 8Bitdo SNES30 (Mode 1): Raw Input, Windows UWP, OSX Native, OSX Fallback: Added mapping now that changes in latest firmware version work with this mode.
    - 8Bitdo SNES30 (Mode 1): Linux Native: Added variant for new firmware changes.
     
    Last edited: Sep 20, 2016
  31. internethip

    internethip

    Joined:
    Oct 21, 2013
    Posts:
    20
    Has someone used rewired with unity networking (unet) ?

    I am having issues figuring out how to make it work as I want. regular unity Input "just works"

    If I launch two instances of the same game. I have it set to that the first player gets id 0 and second player gets id 1. I then do .GetPlayer(id) on that id. But its only the first game which recognizes the controller it would be nice if the second game recognizes the controller as well(its the same controller). I have not tested this on separate machines yet, that might work as intended.

    Is there anyway to make sure I can test on the same machine using rewired in this kind of setup?

    Or is there any documentation about using rewired in a networked environment?

    Edit: Got it working the way I wanted:
    Code (CSharp):
    1.  
    2.             player = ReInput.players.GetPlayer(GetComponent<PlayerID>().id);
    3.             Joystick controller = ReInput.controllers.GetJoystick(0);
    4.             player.controllers.AddController(controller, true);
     
    Last edited: Sep 21, 2016
  32. internethip

    internethip

    Joined:
    Oct 21, 2013
    Posts:
    20
    Is there a way to make sure the game does not receive input from a controller when that window is not "in focus" in windows?

    Edit:
    Solved my issue like this:

    Code (CSharp):
    1.  
    2.         void OnApplicationFocus(bool InFocus) {
    3.             if (!isLocalPlayer)
    4.                 return;
    5.  
    6.             print(InFocus);
    7.             if (!InFocus) {
    8.                 player.controllers.ClearAllControllers();
    9.             } else {
    10.                 Joystick controller = ReInput.controllers.GetJoystick(0);
    11.                 player.controllers.AddController(controller, true);
    12.             }
    13.         }
     
    Last edited: Sep 21, 2016
  33. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Multiple copies of Rewired on the same machine should not have any problems seeing all the joysticks attached to the system.

    I'm not sure what you are trying to achieve here, but when networking, it's far better not to try to use Rewired's Player as your game player. This is not best practice regardless actually. It's better to have some other game player class that simply holds a reference to a Rewired.Player for its input controller. There's no reason the player on machine 1 should ever need to know what the player on machine 2's controls are and vice versa. Each machine is running Rewired independently, potentially using different input sources, etc. There's no server component to Rewired and it's not meant to be an input server. It's strictly a client-side input manager.
     
    Last edited: Sep 21, 2016
    internethip likes this.
  34. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    There is no way to force this in Rewired. It is entirely dependent on the input source in control of the joystick.

    Assuming Windows:
    Direct Input, XInput, and (I believe) Unity input will send input when the window is not in focus.
    Raw Input will not.

    You can always block it at the script level with MonoBehaviour.OnApplicationFocus.

    I have considered adding this as an option, but with uneven capabilities like Raw Input not sending the events, it's not fully supportable unless I can make that work across all input sources and cross-platform. Plus it throws the issue into play that I have to artificially clear input events when clicked outside the window and not all input source elements zero to a zero value. Some platforms/input sources this zero value for unknown controllers can be found, some it can't. It's not a high priority feature to add though since only like 3 people have ever asked about using Rewired in multiple instances of Unity running on the same machine, and almost always it's just for testing purporses. Plus keyboard and mouse input would also have to respect this setting which I believe may also be uneven on the various platforms.
     
    Last edited: Sep 21, 2016
  35. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,462
    @guavaman

    I can't believe it has been two years since your release of Rewired. It is simply amazing all of the controllers that you support. I like the Puma helicopter controller the best so far. Keep up the good work.

    Rewired_controllers.jpg
     
    guavaman likes this.
  36. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Thanks! I also can't believe it's been 2 years already. (Of course it's longer than that for me since I was working on it before it was released.) Thanks for all your support!
     
  37. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,896
    I'm the most unlucky person on earth, this asset is amazing but doesn't have the one controller I really need, the wiimote nunchuk pair...
     
  38. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    1,344
    We have some code that runs fine on Win10 but when a scene first loads on Mac OS X in Awake() or Start()
    ReInput.controllers.joystickCount always returns 0. However, several seconds later, ReInput then can discover the controllers.

    This is at runtime in the editor (both running Unity 5.3.4) with Rewired 1.0.0.102.

    Is there any known workaround for this?
     
  39. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,462
  40. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,896
    That wasn't a question to rewired, that was a contemplation of my absolute misery :p There is so many unused idea with that controller I want to try, but other hacks don't unleash the full power.
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    How To's - Receiving Joystick connect and disconnect events

    Note: Joysticks are not guaranteed to be available on Awake or Start on all platforms or input sources. If Joysticks are available immediately to Rewired on Awake, Joystick connected events will not be sent. If Joystick availability is delayed, a Controller connected event will be sent when Rewired detects the controller. If you need to check for the presence of Joysticks at the beginning of your game, you should always check in both Awake or Start and by subscribing to the ReInput.ControllerConnectedEvent.
     
  42. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    1,344
    The main issue is around menu navigation, because the controllers aren't available (on Mac) when the scene first loads the user can't navigate on-screen nGUI buttons.
     
  43. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    1,344
    I was able to do a combination of manually assigning controllers in Awake(), which works on Win10, then assigned controllers to players using OnControllerConnected() for Mac when Players didn't already have a controller assigned. That way the same code base works on Win10 and Mac.
     
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    That's what docs I linked says to do. You should always check in Awake/Start and OnControllerConnected if you need to know what Joysticks are attached at the beginning of the game or need to use them somehow. Not all input sources / platforms return the devices immediately.

    Rewired's auto-assignment system assigns joysticks on Awake and OnControllerConnected. If you're getting your input from the Player, it won't have a joystick assigned on OSX on the first frame, but whenever OSX reports the joysticks to Rewired, the joystick will be assigned to the Player and you will be able to navigate. This is likely to happen after the first few frames so the delay should be unnoticeable by the user.

    If you're assigning joysticks manually and not using the auto-assignment system, yes, you must do it in both Awake/Start and OnControllerConnected. The example in How To's - Assigning Joysticks to Players also shows how to do this.
     
    Last edited: Sep 26, 2016
    sstrong likes this.
  45. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    Almost all the other controllers Rewired supports are standard HID devices with drivers, either available from the manufacturer or included with the OS, and that conform to the HID Joystick or Gamepad standards. (The only exception is Xbox 360 Controller which is not a standard HID device so drivers must run to create a HID device for it so it can appear to applications. X360 is ubiquitous, so all OS's have a driver for it now that make it appear as a HID Gamepad.) The Wiimote requires special code to read its HID reports manually, or the installation of 3rd party software to map elements or make it appear to the system as a standard device.
     
  46. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
  47. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,896
    Oh thanks that's useful data! I have a starting point to investigate, I don't know much about all of that.

    Right now I found this but still has no idea what to do with this information
    https://www.julianloehr.de/educational-work/hid-wiimote/
     
  48. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,978
    I've seen that driver but haven't tried it. It's supposed to make the buttons and axes visible as standard joystick buttons and axes to Direct/Raw Input (they appear in the Windows Control Panel gamepad configuration dialog.) You could try installing it and then see what elements show up in Rewired. You can either view them with the DevTools/JoystickElementIdentifier tool or use the Control Mapper demo to try mapping them. Control Mapper may be iffy in this case if the axes return absolute screen position values or deltas. Accelerometer/gyroscopes mapped as normal joystick elements don't work well with polling assignment.
     
  49. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,896
    Thank you for the extra info! I'll try. Also I haven't use rewired yet but It's one of the asset that's clearly so good you buy them preemptively :D
     
    guavaman likes this.
  50. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,192
    I'm trying to work through all the documentation but I can't find this.
    Is there a way to know what's the range of an axis for a particular controller?
    I have a throttle in my game, and a flight joystick with a throttle will return a 0 to 1 value (0 off, 1 full throttle), but on the other hand I can also play with a gamepad and I use the left joystick for the throttle which goes from -1 to 1 (accelerate or deaccelerate).

    I need to detect for that axis if my controller will return 0-1 or -1 to 1 values before I decide what to do with them. I checked the AxisRange thing for the mapping but that only returns whatever I set on the xml (positive, negative or full), not what that particular controller will return.

    Any ideas?
     
unityunity