diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index a1969a7bd0..00c6ca33ca 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -22,6 +22,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed missing documentation for source generated Input Action Assets. This is now generated as part of the source code generation step when "Generate C# Class" is checked in the importer inspector settings. - Fixed pasting into an empty map list raising an exception. [ISXB-1150](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1150) - Fixed pasting bindings into empty Input Action asset. [ISXB-1180](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1180) +- Fixed missing '&' symbol in Control Scheme dropdown on Windows platform. [ISXB-1109](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1109) ### Changed - Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086). diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs index 75700a20b8..cd9573e1f3 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs @@ -138,6 +138,18 @@ public override void RedrawUI(ViewState viewState) m_SaveButton.SetEnabled(InputEditorUserSettings.autoSaveInputActionAssets == false); } + private string SetupControlSchemeName(string name) + { + //On Windows the '&' is considered an accelerator character and will always be stripped. + //Since the ControlScheme menu isn't creating hotkeys, it can be safely assumed that they are meant to be text + //so we want to escape the character for MenuItem + if (Application.platform == RuntimePlatform.WindowsEditor) + { + name = name.Replace("&", "&&"); + } + return name; + } + private void SetUpControlSchemesMenu(ViewState viewState) { m_ControlSchemesToolbar.menu.MenuItems().Clear(); @@ -151,7 +163,7 @@ private void SetUpControlSchemesMenu(ViewState viewState) m_ControlSchemesToolbar.menu.AppendAction("All Control Schemes", _ => SelectControlScheme(-1), viewState.selectedControlSchemeIndex == -1 ? DropdownMenuAction.Status.Checked : DropdownMenuAction.Status.Normal); viewState.controlSchemes.ForEach((scheme, i) => - m_ControlSchemesToolbar.menu.AppendAction(scheme.name, _ => SelectControlScheme(i), + m_ControlSchemesToolbar.menu.AppendAction(SetupControlSchemeName(scheme.name), _ => SelectControlScheme(i), viewState.selectedControlSchemeIndex == i ? DropdownMenuAction.Status.Checked : DropdownMenuAction.Status.Normal)); m_ControlSchemesToolbar.menu.AppendSeparator(); }