Skip to content

FIX: [UUM-145509] Simulator Plugin disabling input devices always. - #2457

Open
diverges wants to merge 5 commits into
developfrom
platform/workflows/fix-input-manager-device-simulator-plugin
Open

FIX: [UUM-145509] Simulator Plugin disabling input devices always.#2457
diverges wants to merge 5 commits into
developfrom
platform/workflows/fix-input-manager-device-simulator-plugin

Conversation

@diverges

@diverges diverges commented Jul 22, 2026

Copy link
Copy Markdown

Description

Fix an issue where the Simulator Window would disable all input devices while open even though the window was not focused. This caused "Game View" to not properly receive input events.

  • Added a UI foldout with helpbox explaining this behavior.
  • Used created UIElement to capture the panel InputSystemPlugin connects to.
  • Enable/Disable devices based on SimulatorWindow focus state.
Screen.Recording.2026-07-22.094016.mp4

Testing status & QA

Manual Testing.

Added automated tests for:

  • ConflictingDevicesAreNotDisabledOnCreate
  • ConflictingDeviceAddedWhileSimulatorFocused_IsDisabledThenReenabledOnDestroy
  • ConflictingDeviceAddedWhileSimulatorNotFocused_StaysEnabled
  • ConflictingDeviceAddedWhileSimulatorNotFocused_StaysEnabled

Overall Product Risks

  • Complexity: Low
  • Halo Effect: Low, specific to simulator window integration.

Comments to reviewers

Device simulator related fixes.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration 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:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@cla-assistant-unity

cla-assistant-unity Bot commented Jul 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@diverges
diverges force-pushed the platform/workflows/fix-input-manager-device-simulator-plugin branch from b3043c8 to 96cd571 Compare July 22, 2026 16:53
Fix an issue where the Simulator Window would disable all input devices
while open even though the window was not focused. This caused "Game View"
to not properly receive input events.

- Added a UI foldout with helpbox explaining this behavior.
- Used created UIElement to capture the panel `InputSystemPlugin` connects to.
- Enable/Disable devices based on SimulatorWindow focus state.
@diverges
diverges force-pushed the platform/workflows/fix-input-manager-device-simulator-plugin branch from 96cd571 to c40f0ce Compare July 22, 2026 16:54
@diverges diverges changed the title fix(DeviceSimulator): Simulator Plugin disabling input devices always. FIX: [UUM-145509] Simulator Plugin disabling input devices always. Jul 22, 2026
@diverges
diverges marked this pull request as ready for review July 27, 2026 22:39

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Harness Review

Needs changes

The focus-based change is close, but there is still a play-mode transition hole in the new state machine, and the accompanying test coverage does not build as checked in.

Reviewed commit 0047e168

🤖 Helpful? 👍/👎

Comment thread Assets/Tests/InputSystem/Plugins/DeviceSimulatorTests.cs
@codecov-github-com

codecov-github-com Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 82.35294% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...System/Editor/DeviceSimulator/InputSystemPlugin.cs 66.66% 15 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2457      +/-   ##
===========================================
+ Coverage    78.95%   78.96%   +0.01%     
===========================================
  Files          767      767              
  Lines       140780   140855      +75     
===========================================
+ Hits        111153   111230      +77     
+ Misses       29627    29625       -2     
Flag Coverage Δ
inputsystem_MacOS_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 77.51% <82.35%> (+0.01%) ⬆️
inputsystem_MacOS_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 77.50% <82.35%> (+0.01%) ⬆️
inputsystem_MacOS_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5_project 77.56% <82.35%> (+0.01%) ⬆️
inputsystem_MacOS_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.6_project 77.56% <82.35%> (+0.01%) ⬆️
inputsystem_MacOS_6000.7 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.7_project 77.56% <82.35%> (+0.01%) ⬆️
inputsystem_Ubuntu_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.42% <82.35%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.41% <82.35%> (+0.01%) ⬆️
inputsystem_Ubuntu_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.47% <82.35%> (+0.01%) ⬆️
inputsystem_Ubuntu_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.6_project 77.47% <82.35%> (+0.01%) ⬆️
inputsystem_Ubuntu_6000.7 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.7_project 77.47% <82.35%> (+0.01%) ⬆️
inputsystem_Windows_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.0_project 77.58% <82.35%> (+0.01%) ⬆️
inputsystem_Windows_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.3_project 77.57% <82.35%> (+0.01%) ⬆️
inputsystem_Windows_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.5_project 77.64% <82.35%> (+0.01%) ⬆️
inputsystem_Windows_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.6_project 77.64% <82.35%> (+0.01%) ⬆️
inputsystem_Windows_6000.7 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.7_project 77.64% <82.35%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../Tests/InputSystem/Plugins/DeviceSimulatorTests.cs 100.00% <100.00%> (ø)
...System/Editor/DeviceSimulator/InputSystemPlugin.cs 74.22% <66.66%> (+8.09%) ⬆️

... and 1 file with indirect coverage changes

ℹ️ Need help interpreting these results?

@diverges
diverges requested a review from VeraMommersteeg July 28, 2026 17:13
@Pauliusd01
Pauliusd01 self-requested a review July 29, 2026 06:10
@Pauliusd01

This comment was marked as off-topic.

@u-pr

u-pr Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Test Plan

  • Test plan approved by PR author
  • Test execution in progress
  • Test execution complete
  • Ready for merge

Summary of Changes & Risk Assessment

Summary of Changes

This PR fixes issue UUM-145509 where the Device Simulator plugin would globally disable native Mouse and Pen devices as long as the Simulator window was open. The logic has been updated to only disable these devices when the Simulator window is actually focused, allowing the Game View to receive input when it is the active window.

Key changes include:

  • Polling EditorWindow.focusedWindow in InputSystemPlugin.OnUpdate.
  • Adding focus-aware logic to SetConflictingDevicesDisabled.
  • Updating OnDeviceChange to respect the current focus state.
  • Adding automated tests in DeviceSimulatorTests.cs.

Risk Assessment

  • High Risk Areas: None identified.
  • Medium Risk Areas: None identified.
  • Low Risk Areas: Device Simulator window focus handling, Input System device state management (Enabled/Disabled).

Test Scenarios

Functional Testing

  • Focus Transition: Open the Device Simulator and Game View side-by-side. Focus the Simulator and verify native mouse input is disabled. Focus the Game View and verify native mouse input is re-enabled.
  • UI Verification: Verify that the new HelpBox with the text "Manages Input System devices while the Simulator is focused." appears in the Device Simulator's Input System plugin UI (InputSystemPlugin.cs:L63-70).
  • Play Mode vs Edit Mode: Verify that conflicting devices are always re-enabled when Play Mode is stopped, regardless of focus (InputSystemPlugin.cs:L73-81).

Regression Testing

  • Automated Tests: Run the newly added tests in DeviceSimulatorTests.cs:
    • ConflictingDevicesAreNotDisabledOnCreate
    • ConflictingDeviceAddedWhileSimulatorFocused_IsDisabledThenReenabledOnDestroy
    • ConflictingDevicesReenabledWhenSimulatorLosesFocus
    • ConflictingDeviceAddedWhileSimulatorNotFocused_StaysEnabled
  • Device Addition: Connect a new mouse while the Simulator is open but not focused; verify it remains enabled. Connect it while focused; verify it is disabled.

Edge Cases

  • Window Closure: Verify that closing the Device Simulator window while it is focused correctly re-enables all devices via OnDestroy -> SetConflictingDevicesDisabled(false) (InputSystemPlugin.cs:L179).

💡 This test plan updates automatically when /test_plan is run on new commits. If you have any feedback, please reach out in #ai-qa


🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

- Fixed `OnMouseUpAsButton` and `OnMouseUp` being dropped in Play mode when the Game view's focus changes between a press and its release on Unity 6000.5.0a8 and newer. The legacy `SendMouseEvents` pipeline is no longer driven from `InputUpdateType.Editor` updates, which read the editor state buffer (position (0,0), not pressed) and produced a spurious mouse release that cleared the press target.
- Fixed Input Debugger window's incorrect name. It is now called 'Input Debugger' instead of 'Input Debug' [UUM-137124](https://jira.unity3d.com/browse/UUM-137124).
- Fixed `PoseControl.isTracked` always returning false when read through non-optimized code paths (e.g. Input Debugger) due to `sizeInBits = 8` causing the value to be normalized as `1/255` instead of `1.0`.
- Fixed the Device Simulator plugin keeping the real mouse and pen disabled while working in other Editor windows. Conflicting native `Mouse`/`Pen` devices are now only disabled while the Simulator window is focused and re-enabled as soon as focus moves elsewhere [UUM-145509](https://jira.unity3d.com/browse/UUM-145509).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure this is under the "unreleased" version, we already released 1.20.0

@Pauliusd01 Pauliusd01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, checked the /test_plan command tests, looked over our sample scenes with simulator window open, checked whether simulate touch setting still works

@VeraMommersteeg VeraMommersteeg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs failing is on develop as well, the other functional tests are passsing. Paulius says it still behaves the same so lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants