InputSystem
InputSystem copied to clipboard
FIX: Allow Copy/Paste between windows (ISX-1823).
Description
Fix for ISX-1823.
Changes made
This was previously not working because the Paste command would only apply to the relevant Action Maps/Actions List/Tree, so if neither of those were focused, nothing would happen. We now also listen for Paste at the top level of the element hierarchy and send paste commands from there.
Notes
Issues: • Undoing adding an Action Map/Action leaves the list unselected. Pasting at that point fails because the state thinks there's still a valid item selected. Mentioned here, and should be added as a separate bug. • Currently won't work if the window is tabbed to - user has to click somewhere in the window. Think I'll need to ask UITK team about this.
Checklist
Before review:
- [x] Changelog entry added.
- Explains the change in
Changed
,Fixed
,Added
sections. - For API change contains an example snippet and/or migration example.
- FogBugz ticket attached, example
([case %number%](https://issuetracker.unity3d.com/issues/...))
. - FogBugz is marked as "Resolved" with next release version correctly set.
- Explains the change in
- [ ] Tests added/changed, if applicable.
- Functional tests
Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
. - Performance tests.
- Integration tests.
- Functional tests
- [ ] Docs for new/changed API's.
- Xmldoc cross references are set correctly.
- Added explanation how the API works.
- Usage code examples added.
- The manual is updated, if needed.
During merge:
- [x] Commit message for squash-merge is prefixed with one of the list:
-
NEW: ___
. -
FIX: ___
. -
DOCS: ___
. -
CHANGE: ___
. -
RELEASE: 1.1.0-preview.3
.
-
As a side-note, when https://github.com/Unity-Technologies/InputSystem/pull/1834 lands there will exist an interesting scenario for this functionality when the same asset is open simultaneously in two windows, both in Project Settings and in a free-floating Input Action Editor.
Finished for now. Two bugs not yet fixed are:
1. BUG: trying to paste an action into empty map throws error: --ArgumentException: '0' cannot be greater than -1. 2. BUG: trying to paste a modifier into empty map throws errror --NullReferenceException: Object reference not set to an instance of an object
Once they are fixed it looks good.
Thanks @stefanunity - I believe these should both be fixed now, can you confirm?
https://github.com/Unity-Technologies/InputSystem/assets/54306142/6953ce5a-e7d8-4695-b417-014c8351781a
Cutting and pasting into an empty asset somehow "resurrects" all of the previously deleted actions. (I do deselect ProjectWideActions to confirm the auto save but that does not seem to help)
Thanks @stefanunity - I believe these should both be fixed now, can you confirm?
Both are fixed now.
The bug called out @Pauliusd01 doesn't really make any sense to me but should be fixed. Where is this coming from if not the copy buffer?