Search Unity

Rewired - Advanced Input for Unity

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

  1. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    They are listed on the link I sent you. Look at the last 4 overloads:
    https://guavaman.com/projects/rewir.../T_Rewired_ElementAssignmentConflictCheck.htm

    A struct for use in element assignment conflict checking. Overload for complete assignment.

    I can't tell you why it's not working with the information I have. There are many things that could make a conflict not be detected including your Map Category conflict checking settings defined in the Rewired Input Manager, what Controller Maps and Action Element Maps exist in the Player at the time you are doing this check, whether those maps are enabled and whether you specified to only check against enabled maps when you called one of the Conflict Checking methods in the Player or in all Players if you are using the ReInput.ConflictCheckingHelper methods etc. It will also not work if you didn't provide all the required properties in the ElementAssignmentConflictCheck.

    The low-level conflict checking API is used in Control Mapper. You can look at the Control Mapper source code to see how it's used there. All other examples included with Rewired use the Input Mapper class for control rebinding because it's infinitely simpler to use.
     
  2. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    180
    I don't really understand. You mentioned 4 overloads which all of them has KeyCode argument so non of them are good for mouse and joystick. Also I don't understand what is complete assignment is.

    Please tell me for mouse, I should use which overload ?
    For joystick which one ?
    and for keyboard which one ?
    And why they are not same for all of them ?

    Setting actionId and controlMapId in ElementAssignmentConflictCheck are for ignoring conflict on exactly that assignment which are currently on if we want to assign same element and search for the others ?
    Also I pass false for skipDisabledMaps.
     
    Last edited: May 31, 2020
  3. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    A "complete assignment" is an assignment that allows you to set all possible parameters for the assignment at the same time. You don't even need to use a constructor to do this. ElementAssignmentConflictCheck is a struct. It simply carries data that describes what you want to check. Fill in all the properties it exposes manually and you've also made a complete assignment.

    As I said, the last 4 overloads are the ones you use for creating an assignment for any controller type:

    fda.png

    Look at the the highlighted arguments in the image above. These two arguments determine the controller type and the element type. From this information, all possible types of controllers and all possible types of elements can be set using a single overload.

    It does not matter that a Mouse does not have keyboard keys. These values are ignored when controllerType is set to ControllerType.Mouse. They are used when it is set to ControllerType.Keyboard.

    elementMapId is used to ignore self so conflicts are not returned for the same mapping you are potentially replacing.

    controllerMapId is used to determine the Map Category of the Controller Map in question because the conflict checking system is based on the Map Categories configured to conflict (or not) with one another in the Rewired Input Manager.

    actionId is unused in the actual conflict check, but is used when converting an ElementAssignmentConflictCheck into an ElementAssignment using one of the conversion functions like ToElementAssignment.
     
    Last edited: Jun 1, 2020
    a-t-hellboy likes this.
  4. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Rewired 1.1.35.0 is available on the Unity Asset Store:

    See Updating Rewired.

    Release Notes:

    1.1.35.0:

    Changes:
    - Control Mapper: Added LanguageDataBase.GetActionCategoryName method.

    Changed Controller Definitions:
    - Ipega Bluetooth Classic GamePad, Android Fallback: Added new variant for changes made to device / firmware.
    - 8Bitdo SN30 Pro: Added support for changes made to firmware 1.33 and mappings for SN30 Pro+.

    Bug Fixes:
    - Control Mapper: Fixed bug introduced in 1.1.33.0 causing Action Category names to be read from Map Category instead.
     
  5. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    180
    Hey there,

    ElementAssignmentConflicts 
    makes different between different map categories ? It is done by ControllerMapId ?
    Because I have different categories like Metagame and Gameplay but if I press the key which is exactly in other category it returns conflict. Does it make sense ?
    I'm pretty sure I pass correct ControllerMapId.

    Also I noticed there is no self check about conflicts.

    Edit: I try to check these 2 myself but I don't know if Rewired conflict function has support for them or not.
     
    Last edited: Jun 3, 2020
  6. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    180
    Hey there again,

    About polling, I use
    ReInput.controllers.polling.PollControllerForFirstElement
    . If I try mouse wheel, it returns Mouse Wheel itself, not Mouse Wheel Up or Down. What should I do about it ?
    Same thing about Left Sitck and Right Stick too.
     
  7. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    No. You do not set up rules about what to conflict check against in the ElementAssignmentConflictCheck. Rules are all set up beforehand in the Rewired Input Manager:
    https://guavaman.com/projects/rewired/docs/ControlMapper.html#conflict-checking

    I don't understand what you're saying.

    Yes it does. It returns a large struct which contains the entire description of the mapping including partial axis mappings.

    https://guavaman.com/projects/rewir...l/T_Rewired_ElementAssignmentConflictInfo.htm

    Look at this:

    https://guavaman.com/projects/rewir..._ElementAssignmentConflictInfo_elementMap.htm

    The Action Element Map is a complete description of the binding that conflicted.

    This Conflict Checking and low-level mapping API has always been considered an advanced topic and is unsupported. I have provided you with a complete example on using the system -- the Control Mapper source code. This is and always has been the documentation for this topic. I have also provided you a complete, easy to use wrapper -- Input Mapper -- which is a replacement of this undocumented low-level API. The intended and supported way to remap controls in Rewired is through Input Mapper,.not the API you're using. It is taking a great deal of your time and mine because you're not using the provided system for handling input mapping and are trying to use the low-level system without thoroughly understanding it by using the source code example provided for it as a guide. Even I do not use this low-level API since Input Mapper was created to wrap it and simplify it.
     
    Last edited: Jun 3, 2020
  8. giantdoor

    giantdoor

    Joined:
    Sep 11, 2018
    Posts:
    52
    Hi @guavaman!
    First of all great asset, still the best way of managing Input in Unity after all these years <3
    I have a problem with Control Mapper when updating to 1.1.35.0:
    The release note says "- Control Mapper: Added LanguageDataBase.GetActionCategoryName method." but git doesn't detect any change in any of the Control Mapper files, and also such method is not there.
    I tried to delete the zip and reinstall CM but still I have no changes... what could it be?
     
  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    :mad:

    Download it here:
    https://www.dropbox.com/s/0aemoz7jevndtyv/ControlMapper_TMPro.zip?dl=0
    https://www.dropbox.com/s/kdpbwos54rb503n/ControlMapper.zip?dl=0

    There goes another 4 hours publishing another update.
     
  10. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    180
    What is the reason you didn't put these kind of check in
    ElementAssignConflicts 
    ? (Different category check, redundant element assignment and so on)

    Also I just noticed there is no conflict check on same action but different axis contribution!
    Although
    ElementAssignConflicts 
    gets all of these information.

    My second post is not about conflict and related functions, it is about polling.
    Please read it again.
    I don't find axis information in ControllerPollingInfo.
     
    Last edited: Jun 4, 2020
  11. giantdoor

    giantdoor

    Joined:
    Sep 11, 2018
    Posts:
    52
  12. Thickney

    Thickney

    Joined:
    Mar 3, 2013
    Posts:
    32
    Is there a preprocessor directive for whether Rewired exists in a project? I'd like to add some basic integration for Rewired in my plugin. I thought I saw it being used years ago but I can't find any mention of it now.
     
  13. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Because I designed my system to work that way. You set up your categories first and the checking rules in a data-driven way, not when you make the function call. Conflict checking rules are all based on the map categories of the maps in question. Everything is based on Controller Maps.

    You are confusing the Action system with Controller Elements. Conflict checking cannot be used to prevent you from making multiple bindings to an Action. That is not its purpose. It is perfectly acceptable to bind as many different Controller elements to the same Action as you want.

    Conflict checking's only purpose to make sure you're not assigning the same Controller Element to multiple bindings. That's all it does.

    Axis Contribution is purely related to the Action and has nothing to do with the Controller Element. Axis Contribution describes the +/- value contribution to the Action's Axis value when queried. A keyboard key with a negative Axis Contribution means the Action to which it is bound will return a negative value when queried as an Axis.

    https://guavaman.com/projects/rewired/docs/api-reference/html/T_Rewired_ControllerPollingInfo.htm

    https://guavaman.com/projects/rewir.../P_Rewired_ControllerPollingInfo_axisPole.htm


    dasas.png
     
    Last edited: Jun 4, 2020
    a-t-hellboy likes this.
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Not your fault. It's mine for not copying the zips to the right folders before I uploaded it. The angry face was aimed at myself. Thanks for telling me.
     
  15. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    No. Plugins cannot reliably manage preprocessor directives. This isn't something Unity makes easily available to you and it's full of problems if you do it. Every platform has its own list of directives. The user can change or delete them at any time. You have no way of deleting them when the user removes your application. They're just not feasible to be used by asset developers for this purpose.

    Use reflection. That's the only reliable way.
     
    Thickney likes this.
  16. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    180
    Yup, you are right. Then what is your suggestion for checking conflict on same action but different axis contribution ? For example there are Move Horizontal and Vertical actions but they have positive and negative axis contributions for keyboard which are Move Forward, Backward, Left and Right. Assume W is Move Forward element and I want to change Move Backward element to W too. So there should be a conflict.

    Yup, I'm so dumb. I have found it before actually. I misunderstant Axis Contributuin (Pole) and AxisRange.

    My actual problem is how to figure out if the polled element by user is Mouse Wheel Up and Down or Left Stick X - and + and these kind of axes ? I don't know how to get AxisRange from ControllerPollingInfo.
     
    Last edited: Jun 5, 2020
  17. hubrobin

    hubrobin

    Joined:
    Jan 25, 2016
    Posts:
    5
    Hey,

    is there a way to configure "Ignore Input When App Not In Focus" per input device? I want it to be enabled in the editor for keyboard/mouse, but disabled for gamepad.
     
  18. longroadhwy

    longroadhwy

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

    It looks like your second update is already in the Asset store.

    1.1.35.1: Bug Fixes: - Control Mapper changes that were supposed to be inlcuded in 1.1.35.0 are now included.
     
  19. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Trying to assign the same keyboard key to both the positive and negative pole of an Action will trigger a conflict. When you try to assign W to Move Vertical +, it will already see that W is assigned to Move Vertical - and will conflict. Open Control Mapper or Control Remapping Demo 1 and you will see exactly this happen.

    If this is not happening, then you are not providing the right information in the ElementAssignmentConflictCheck. It must have a complete description of the element you are trying to assign, and only if you are replacing an existing assignment would you ever supply an elementId to make it ignore that existing binding. Supplying an element id on a non-replacement binding will cause it to ignore that existing binding when doing a conflict check.

    What you're asking for doesn't exist in ControllerPollingInfo because it wouldn't make any sense.

    Axis Range is an enum with 3 values:
    Full
    Positive
    Negative

    Pole is an enum with 2 values:
    Positive
    Negative

    You are polling an axis on a controller to find out what the user's input was. ControllerPollingInfo is returning a snapshot of information tell you, for example:

    "The user moved the mouse up"
    "The user moved the mouse wheel down"
    "The user moved the stick left"

    There are only two possible directions the user can move an axis:
    Positive
    Negative

    The user cannot possibly move an axis "Full". That makes no sense. That would tell you absolutely nothing if it returned a value of AxisRange.Full when the user pressed a stick, moved a mouse, turned a racing wheel, pulled a level, or any of the other forms an axis comes in.

    If you're trying to pass the pole to some function that takes an AxisRange value, you have to convert it manually. if(pole == Pole.Positive) value = AxisRange.Positive; etc.
     
    Last edited: Jun 5, 2020
    a-t-hellboy likes this.
  20. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    No.
     
  21. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Thanks!
     
  22. Undertaker-Infinity

    Undertaker-Infinity

    Joined:
    May 2, 2014
    Posts:
    112
    Oh man, now I get it. Nothing to raycast, of course joy won't pick up the input. I just changed the stick to be the size of the container with a flat color (no sprite), and set the stick as invisible in Touch Joystick.
    Everything works and I have a nice deadzone. Also, axis are relative to the object so I can rotate the controls without additional code, so that's nice.
    Thanks!
     
  23. ObsidianSpire

    ObsidianSpire

    Joined:
    Sep 13, 2013
    Posts:
    48
    Hi. Is there a way to call custom code whenever a controller disconnects or reconnects? I'd like to update the information displayed in levels to correspond to the active controller(s).
     
  24. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    ObsidianSpire likes this.
  25. ShervinM

    ShervinM

    Joined:
    Sep 16, 2017
    Posts:
    67
    Hi @guavaman !

    I seem to have run into an issue and was wondering if you could help.

    I'm seeing the editor freeze when I click play on any of our scenes with InputManager component in it. To be absolutely sure its Rewired, I created a new scene, created a new gameobject, added InputManager (and referenced the default Controller Data Files). Again, unity freezes when I click playmode and I have to then restart the editor.

    Some more information:
    1. This is only happening on 1 out of 3 machines I've tested my project on. The other two dont have this freezing issue.
    2. Looking at previous rewired update logs, i see there was some freezing issue due to something related to XInput. I wonder if it could be that? In any case I updated rewired to the latest version (going from 1.1.26.1 to 1.1.35.1) but still no luck.
    3. I tried running this same empty scene with no controller data files referenced in the InputManager. Sure enough i get errors telling me its null, but at least playmode doesnt freeze. I then figured maybe my default ControllerDataFiles is corrupted. But even after deleting the data file, re-importing it from the unity asset store, and re-referencing it I still see the freeze issue.
    4. I've attached my Unity Editor log but I dont seem to see anything related to Rewired spitting out.
    5. I've also attached a DirectX Diagnostic Result in case theres any system specs you may need.

    Any help you could provide would be greatly appreciated!! Please let me know if I can provide any other information!

    UPDATE:
    I should mention im using Unity Version 2019.1.10.f1. I just created a new project using this same version, and installed a clean copy of rewired. Im getting the freezing issue in this brand new project as well
     

    Attached Files:

    Last edited: Jun 8, 2020
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    This kind of issue can only possibly be diagnosed by manual debugging effort, logging every single function call made, modifying code to log more based on the results, running again and again until the culprit function call is found.

    There are zero other reports of anything like this from the 10,000 Rewired users out there, therefore, I can only surmise it is something on or connected to your system.

    Go through steps one by one to narrow down a code path:
    1. Disconnect every USB and Bluetooth device on your system. Test.
    2. Disable Use XInput. Test.
    3. Disable Native Keyboard Support. Test.
    4. Disable Native Mouse Support. Test.
    5. Disable Enhanced Device Support. Test.
    6. Change the Primary Input Source to Direct Input. Test.
    7. Change the Primary Input Source to Unity Input. Test.
     
  27. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Looking at DxDiag.txt, one thing stands out to me:

    Corsair Gaming K95 RGB PLATINUM Keyboard

    See this:
    https://guavaman.com/projects/rewired/docs/KnownIssues.html#windows-10-second-stall

    This is the 4th or 5th time I've had some kind of report involving a Corsair keyboard. There is an on-going problem with them and it appears to be due to a recent Windows update. Based on my understanding of the problem after having spent many, many hours debugging this at a low level, there is no fix possible on my end because the problem is not on my end. I have already made changes to my code to attempt to workaround this low-level issue in Windows in 1.1.34.1:

    If your problem has anything to do with this keyboard, then there's nothing I can do. Corsair and/or Microsoft is going to have to fix this. The only things I can do is to attempt to make, frankly ridiculous workarounds to try preventing calling core Windows API HID functions on these devices.

    Unplug the keyboard and test. If your problem goes away, then there are even more low-level problems with these keyboards than I am currently aware of beyond the HidD_GetProductString stall.
     
    ShervinM likes this.
  28. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Someone mentioned power profile elsewhere. I would be curious if this was causing the issue. I have this problem with external USB blu-ray drives.

    https://www.windowscentral.com/how-prevent-windows-10-turning-usb-devices

    Did you see these posts already?

    https://forum.corsair.com/forums/showthread.php?t=169459

    https://forum.corsair.com/v3/showthread.php?t=191163
     
    ShervinM and guavaman like this.
  29. ShervinM

    ShervinM

    Joined:
    Sep 16, 2017
    Posts:
    67
    Well @guavaman,

    You're honestly a champion. Unfortunately I can't unplug the keyboard as the computer is a laptop (no external keyboards were connected, I guess Corsair makes the built in keyboard?).

    I went through some of the steps above, but after reading your comment about recent windows updates, I figured I should check to update my windows. Sure enough after the update, the issue is gone.

    I wish I had checked which previous windows update I was on in case that could have helped you, but yeah I see your point. Can't really do much when the issue stems from Windows.

    In any case, again, thank you a million times, especially for such prompt responses. This is my second post here but I cant tell you how many times this thread or the thorough documentation has helped me out. And not to forget the COUNTLESS hours Rewired has saved me from my crappy solutions I had before.

    Also thanks @longroadhwy, checking those links out now.
     
    guavaman likes this.
  30. Dramamine0001

    Dramamine0001

    Joined:
    Mar 23, 2014
    Posts:
    84
    I'm working on a mobile game and have a Touch Controller with a Touch Joystick setup and working beautifully. I'm wanting to setup a Touch Pad taking up most of the screen to allow a user to touch specific area. I can't seem to find an example in documentation or the example scenes of how to get the screen location of where was clicked in scripting. Please advise. Thanks!
     
  31. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    The Rewired Touch Pad control is not a replacement for UnityEngine's touch input system. It does not give you information about what you touched or where, it cannot be used for gesture detection or selecting objects by touch, and it does not support multi-touch. It exists for simulating a mouse-like touch area on the screen as a control to give you a delta value for something like rotating a camera. It will not do what you want it to do. Use UnityEngine.Input's touch functions for that.
     
  32. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I am trying Unity 2020.2a14 and I get :

    Rewired: The version of Rewired installed (1.1.35.1.U2019) was not designed for Unity 2020. Please install Rewired for Unity 2020.

    I understand that I may redownload rewired, but I think I did again through package manager ( because Asset Store Window is no more ) but I still get the warning. Am I fair to say, I will need to wait for the 2020.2 version? Or Is there 2020.x version that I am meant to use?
     
  33. giantdoor

    giantdoor

    Joined:
    Sep 11, 2018
    Posts:
    52
    @guavaman is there some kind of PropertyAttribute or Enum to have a dropdown list of all the supported Joysticks in the inspector?
    I'm talking something that would display those values:
     

    Attached Files:

  34. Dramamine0001

    Dramamine0001

    Joined:
    Mar 23, 2014
    Posts:
    84
    Thanks for the reply!

    I'm highly confused what the Touch Pad Mode option is for then, as it has an option to return screen position.

    I'll use Unity's as you suggest. Thanks again!
     
  35. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Alpha and beta versions of Unity and experimental features are not supported:

    https://guavaman.com/projects/rewir...ng.html#unity-alpha-beta-preview-experimental
     
  36. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    No. Supported Joysticks are data-driven. To do what you're asking the list would have to be baked out to code.
     
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Using a touch pad with Touch Pad Mode set to Screen Position with Value Format set to Pixels will just pass through the value from Input.touches[0].position. You would get this value the exact same way you get any other value from the Touch Controls -- getting the Action value from the Player or through the OnValueChanged event.

    The Touch Pad control isn't very good at being used as a replacement for UnityEngine.Input.touches. It supports only one finger and doesn't give you any access to the touch state, position delta, or any of the other values required for touch gesture interpretation. That's not what the control was meant to do. Exposing the screen position directly was done for the rare case where just having that specific position value may be useful for something. I can't think of a compelling reason to use it.
     
  38. giantdoor

    giantdoor

    Joined:
    Sep 11, 2018
    Posts:
    52
    I see, I also found the explanation of how to achieve dynamic Glyphs/Actions, but I'm missing a piece: where is RewiredConsts defined?
    Cause i need to use [ActionIdProperty(typeof(RewiredConsts.Action))] but the class is missing :S
     
  39. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Hello friends, I just wanted to post an issue I'm noticing with Unity 2019.4 LTS.
    My keyboard input is acting as though inputs are getting buffered / delayed in some way. I've tested the same commit of my project with 2019.3.15f1 and 2019.4 and only see the problem in this new version of Unity.

    I wondered if anyone else is seeing this issue? The issue does not seem to appear when using Joystick input.
     
  40. giantdoor

    giantdoor

    Joined:
    Sep 11, 2018
    Posts:
    52
    Nevermind @guavaman I found it... maybe add the RewiredConst tag to the Rewired Editor "Tools/Export" explanation, as that doesnt pop up if you seacrh for "RewiredConsts" in the documentation :)
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Known Unity issue:

    https://guavaman.com/projects/rewir...#windows-editor-keyboard-keys-stuck-raw-input
     
    rxmarccall likes this.
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    RewiredConsts does not even exist unless you choose to export constants and choose to name them RewiredConsts.

    This is already fully and clearly explained in the documentation:
    https://guavaman.com/projects/rewired/docs/HowTos.html#exporting-constants
    https://guavaman.com/projects/rewired/docs/Actions.html
     
    Last edited: Jun 13, 2020
  43. giantdoor

    giantdoor

    Joined:
    Sep 11, 2018
    Posts:
    52
    I didn't say that the explanation is lacking; in fact it's really good.
    I just said that, sometimes, one might be not know exactly what to search for in a documentation as big and comprehensive as the Rewired one: as I stumbled upon an example code snippet mentioning the RewiredConsts class, I tried to search for it in the documentation, typing "RewiredConsts" in the search bar. That didn't return anything other than the examples page I was already looking at; therefore my suggestion of adding a tag to the page you just linked me, so that it will pop up in the search if someone writes "RewiredConsts".
     
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Thanks. I understood that.

    1. Adding a tag wouldn't make any difference. The search function already works exactly how you are describing. The page I just linked you that talks about the constants is the exact same page and the only one that the search function in the documentation returns. HowTos.html. The 2nd link I sent you merely links back to that same page when mentioning constants can be supported for Action ids. The search function already shows you the relevant page:


    fdsaf.png


    2. Using the browser search function on the page, there are only 2 instances of "RewiredConsts" on the page. The first is the link I sent you which discusses exporting constants:


    fdsaf2.png


    The second instance on that page is in the section "Displaying a drop-down list of Actions in the inspector of a script" and already contains a link to the section describing exporting constants in Step 1:


    fdsaf3.png


    There are no other instances of the term "RewiredConts" anywhere in the documentation. As I see it, the documentation for this is as it should be and there is nothing to be fixed or improved.
     
    Last edited: Jun 15, 2020
  45. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi,

    Due to serveral reason.i have to start my application with
    - latest Rewired
    and
    - Unity 2019.4.0f1 LTS

    start /D .\UI UI.exe -screen-fullscreen 0 -popupwindow -screen-width 3840 -screen-height 1080 -window-mode exclusive


    Because
    -screen fullscreen is 0
    i cannot get any Rewired input.

    The Rewired input is working when i set
    -screen-fullscreen 1
    and when i have the window in focus like

    start /D .\UI UI.exe -screen-fullscreen 1 -popupwindow -screen-width 3840 -screen-height 1080 -window-mode exclusive

    Is there a way to get Rewired input with
    -screen-fullscreen 0
    ?

    Thanks.
     
  46. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    Rewired has no issues running in full-screen or windowed modes.

    Is the game window the focused window? If not, input is not going to work unless you disable Ignore Input When App Not In Focus.
     
    keeponshading likes this.
  47. hugopok

    hugopok

    Joined:
    Mar 30, 2016
    Posts:
    46
    Hi, i am using rewired for a game that i am working on,which is a party game, so more controllers can be handled at the same time, i wanted to know if a player with a certain id is using a keyboard or the controller
     
  48. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,627
    This is a very broad and vague question. You need to give me more information about exactly what you are trying to do.

    The only thing I can tell you:
    https://guavaman.com/projects/rewired/docs/HowTos.html#last-used-controller

    You have complete control over all Players. You have complete information about all the Controllers assigned to all Players. Use this information to figure out what you're looking for:

    https://guavaman.com/projects/rewired/docs/api-reference/html/T_Rewired_Player.htm
    https://guavaman.com/projects/rewired/docs/api-reference/html/T_Rewired_Player_ControllerHelper.htm
     
  49. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Holy moly. Thanks. This did the job.
     
  50. Digital_Seven

    Digital_Seven

    Joined:
    Aug 20, 2015
    Posts:
    15
    Code (CSharp):
    1. _rewiredPlayer.AddInputEventDelegate(OnButtonActionComplete, UpdateLoopType.Update,
    2.                 InputActionEventType.ButtonJustPressedForTime, RewiredAction, new object[] {2.0f});
    So I'm having a situation where the above code only fires the callback after 4 seconds (realtime, according to my stopwatch) The amount of time always seems to be twice the time I put in the optional value.