Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ however, it has to be formatted properly to pass verification tests.

## [Unreleased] - yyyy-mm-dd


### Fixed
- Fixed an issue causing the Action context menu to not show on right click when right clicking an action in the Input Action Editor [ISXB-1134](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1134).

## [1.11.2] - 2024-10-16

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public ActionMapsView(VisualElement root, StateContainer stateContainer)
m_AddActionMapButton.clicked += AddActionMap;

ContextMenu.GetContextMenuForActionMapsEmptySpace(this, root.Q<VisualElement>("rclick-area-to-add-new-action-map"));
// Only bring up this context menu for the List when it's empty, so we can treat it like right-clicking the empty space:
ContextMenu.GetContextMenuForActionMapsEmptySpace(this, m_ListView, onlyShowIfListIsEmpty: true);
}

void OnDroppedHandler(int mapIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ public ActionsTreeView(VisualElement root, StateContainer stateContainer)

ContextMenu.GetContextMenuForActionListView(this, m_ActionsTreeView, m_ActionsTreeView.parent);
ContextMenu.GetContextMenuForActionsEmptySpace(this, m_ActionsTreeView, root.Q<VisualElement>("rclick-area-to-add-new-action"));
// Only bring up this context menu for the Tree when it's empty, so we can treat it like right-clicking the empty space:
ContextMenu.GetContextMenuForActionsEmptySpace(this, m_ActionsTreeView, m_ActionsTreeView, onlyShowIfTreeIsEmpty: true);

m_ActionsTreeViewSelectionChangeFilter = new CollectionViewSelectionChangeFilter(m_ActionsTreeView);
m_ActionsTreeViewSelectionChangeFilter.selectedIndicesChanged += (_) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,16 @@ public static void GetContextMenuForActionMapItem(ActionMapsView mapView, InputA

// Add "Add Action Map" option to empty space under the ListView. Matches with old IMGUI style (ISX-1519).
// Include Paste here as well, since it makes sense for adding ActionMaps.
public static void GetContextMenuForActionMapsEmptySpace(ActionMapsView mapView, VisualElement element, bool onlyShowIfListIsEmpty = false)
public static void GetContextMenuForActionMapsEmptySpace(ActionMapsView mapView, VisualElement element)
{
_ = new ContextualMenuManipulator(menuEvent =>
{
if (!onlyShowIfListIsEmpty || mapView.GetMapCount() == 0)
{
var copiedAction = CopyPasteHelper.GetCopiedClipboardType() == typeof(InputAction);
if (CopyPasteHelper.HasPastableClipboardData(typeof(InputActionMap)))
menuEvent.menu.AppendAction(paste_String, _ => mapView.PasteItems(copiedAction));
var copiedAction = CopyPasteHelper.GetCopiedClipboardType() == typeof(InputAction);
if (CopyPasteHelper.HasPastableClipboardData(typeof(InputActionMap)))
menuEvent.menu.AppendAction(paste_String, _ => mapView.PasteItems(copiedAction));

menuEvent.menu.AppendSeparator();
menuEvent.menu.AppendAction(add_Action_Map_String, _ => mapView.AddActionMap());
}
menuEvent.menu.AppendSeparator();
menuEvent.menu.AppendAction(add_Action_Map_String, _ => mapView.AddActionMap());
}) { target = element };
}

Expand Down