InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

FIX: Fixed unexpected control scheme switch when using `OnScreenControl` and pointer based schemes (ISXB-656)

Open bmalrat opened this issue 1 year ago • 1 comments

Description

When using an OnScreenControl with default Control scheme with a Move Action it will trigger a Cancel event on every frame since if will autoswitch back to pointer device when the user made an input and the OnScreenControl will switch back to the emulated one.

ISXB-656 The "Cancel" event is registered every frame when the Move action is used

Changes made

Added an instance counter to OnScreenControl to know if there is an active one. Added a check in player autoswitch filter to prevent switching to pointer scheme when using an OnScreenControl Changed OnScreenControl to automatically switch to a scheme that use the emulated device to prevent some remaining interaction when is was previously using a pointer.

Testing

added test and tested on customer project

Risk

I added the auto switch to target device in the OnScreenControl but I'm not sure if it's the right condition. For now it's only on the first control if it's not part of the current player device. But it may be better to just move aways from pointer devices in all case 🤔. (or remove that part of the change)

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.
    • JIRA ticket linked, example (case %<ID>%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • [X ] Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • [X ] 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.

After merge:

  • [ ] Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

bmalrat avatar Oct 02 '24 13:10 bmalrat