-
Notifications
You must be signed in to change notification settings - Fork 329
Adding generalized support for controller usages with the binding path dropdown. Added optional info blurb on the binding paths covered #1676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…well as listing out the specific device paths that match to a binding
…ages, now shows a message when no matching registered paths exist
…additional contexts
…ity-Technologies/InputSystem into inputbinding-controlusages-UI
Using a foldout instead of a checkbox probably makes for a sightly nicer UI. Also, "Matching Controls" maybe slightly clearly naming than "Matching Paths". |
Tweaked the UI to the PR suggestions. @reviewers this PR makes some changes to the editor display code, and potentially incurs some new performance overhead. Are there any tests or things we can run to see if the performance impacts are acceptable? |
Hi there, finally got time to look at this. So, as I understand it, the idea is to make it clear what the general purpose abstractions in the input system actually bind to, right? It's probably a good idea to add this - I thought about it before too. My idea for how to solve it was to do it an a more visual way though. Question: Is the flyout open or closed by default? Probably I think it should be closed, otherwise it's quite overwhelming. And, is it displayed when you bind an action directly to an input control? Does it only show if you use an abstraction like GamePad? If not, it probably should do that I think - I mean only be visible when the user is binding to a device abstraction. |
Also, as you can see in the screenshot above, I am wondering if we really need to show the derived bindings different between Xbox Controller, Xbox Controller iOS, Xbox Controller Android? They always seem to be the same anyway, so it seems like redundant information? |
Note also that we are working on a UI Toolkit implementation of this UX so we need to add support into that implementation too. The current work is in develop and behind a flag. See https://docs.google.com/document/d/1ot1-Cr85TxpZGudm-VXvE4-C2YAATqiQcYkc_ww76eI/edit#heading=h.aasuoa63b4nd Specifically this feature flag needs to be set to true to see the (incomplete) UI TK version InputFeatureNames.kUseUIToolkitEditor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions and nitpicks.
Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs
Outdated
Show resolved
Hide resolved
…olPath.cs Co-authored-by: Dave Ruddell <94039157+vrdave-unity@users.noreply.github.com>
…e used instead of continue
Thanks for the suggestions @vrdave-unity. I incorporated all of them, though I have a question. On a given layout, 2 physical buttons should never have the same usage correct? @Billreyn I really like the layout mockup idea you have there. It's much more elegant than an optional dropdown that you have to expand in the binding properties pane, and the nested structure really helps contain the bloat. Do you have a reference implementation, or can you point me to the code paths I need to touch to make this a reality?
On this topic, I think it's still important to make this information accessible, since it helps expose all of the controller layouts that are currently registered (and in some cases, exposes the fact that you may have missed registering certain layouts!) This is especially useful in the XR space, since there's a bit of a manual process to configure your project to support the wide range of XR controllers available. @lyndon-unity I'm not certain what additional work needs to be done here to account for the concurrent UI toolkit work. Can you give some more details? |
Like Lyndon already mentioned we will need this feature to support the newer UIToolkit editor window as well. |
…rived layout types, updated dictionary to use a hashset for performance
Hey there guys, I haven't gotten a chance to update the UIToolkit editor window, but I have updated the Matching Controls section to be a foldout. I did try to incorporate the feedback to move this information directly into the bindings list, but encountered some issues with creating the UI elements there, since it's implemented as a I left some comments in the code regarding some edge cases I encountered as I was debugging and implementing the foldouts, if anyone has any feedback, it'd be greatly appreciated! |
Hi Roger. Derived bindings is fine with us :) |
Also as you mention above This doesn't show a match because its a single direct match This does feel quite confusing to me. I thought it might be a invalid path, its not possible to tell the difference between invalid path and valid path (unless you've got one that has some derived types that it lists).
|
Found a bug, when adding 2 or more * at the front of the binding path the whole binding properties sidebar layout breaks. Steps to repro: Type in this path Alternatively you can also break the UI by using multiple categories in the same path such as: |
@Pauliusd01 bugs should be fixed! |
Formatting tests are failing - looks like it needs the formatting run on it [19:05:56.456 Information] Starting process on subprocess runner |
There is also a code analyzer failure. Seem to be this error : I can't quite see what's triggering it. Here's a link about that kind of error: dotnet/roslyn#29371 I see a few occurrences of this failure on your branch I'm not seeing the failure on develop |
small ping after fixing the formatter errors @lyndon-unity @Pauliusd01 |
LGTM. Things checked: Note: One bug that I did notice was a fairly rare Editor freeze under the Application.Message.MouseMove call when selecting the binding path's text (only 4 times in the whole testing period) but it was ruled out as potentially caused by this PR by Roger so I'll try to nail it down and report separately |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to approve now that Paulius has QA'd it.
Waiting for someone here to ultimately merge this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this this over the line @RogPodge
Migrated from #1672
Description
This PR augments the binding path dropdown, allowing users to add control usages for specific devices.
This PR also adds a "Show Matching Paths" checkbox, which shows the users exactly which specific registered layout paths their current binding path will match with.
The goal of this PR is to address some grievances found in this thread: https://forum.unity.com/threads/openxr-primary2daxisclick-not-working.1120864/
General.Binding.Editing.mp4
Failure.Case.mp4
Changes made
Updated the InputControlPickerDropdown to allow for control usages to be selected and added to the paths in after specifying a desired device.
Augmented the UsageDropdown to be usable in more contexts.
Added unit tests for the new InputControlPath function.
Added new option to the InputBindingsPropertiesView.
Notes
Please write down any additional notes, remove the section if not applicable.
Checklist
Before review:
Changed
,Fixed
,Added
sections.([case %number%](https://issuetracker.unity3d.com/issues/...))
.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.