Unity-Technologies / InputSystem

An efficient and versatile input system for Unity.
Other
1.42k stars 306 forks source link

FIX: ISXB-704 scroll wheel support windows raw input value #1946

Closed benoitalain closed 2 months ago

benoitalain commented 3 months ago

Description

Fixes ISXB-704. Based on recently landed trunk PR.

Details of what was changed and the thought process can be found in this Google Document: https://docs.google.com/document/d/1XCC6GqaWzKf1M1jm-UmKRn6sIlmvF7rvF1C8Ws5Yxa4/edit?usp=sharing

This PR introduces a new Settings option for the InputSystem package. See screenshot: image

When the "Keep Platform Specific Input Range" option is selected, InputSystem actions that result from a Scroll Wheel hardware input will be expressed in the OS native range when retrieved with the InputAction.CallbackContext.ReadValue<Vector2>() method. On Windows, the values should range between -120 to 120, whereas on other platforms it will remain between -1 and 1 in general.

The new setting's default option is "Uniform Across All Platforms". When that option is selected, InputSystem actions that result from a Scroll Wheel will always be expressed in the -1 to 1 range, regardless of platform.

Changes made

Please write down a short description of what changes were made.

Notes

Please write down any additional notes, remove the section if not applicable.

Checklist

Before review:

During merge:

After merge:

unity-cla-assistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

ekcoh commented 3 months ago

Looks like a branch update and CI rerun might be in order.

benoitalain commented 2 months ago

Couple of concerns from me:

  • I did not need these changes to fix the issue, simply opening the Editor version that has your latest changes is enough to fix it
  • The ifdefs for the code are not granular enough and I still get errors about missing Editor code on 6.0.6f1 Editor, should that be changed?

Also, please take a look at the slack discussion about this change in our input channel

You say you only need the Editor changes, are you sure there's no copy of my package fixes that survived in your Library folder? Otherwise I can't see how the InputSystemUIInputModule fixes could come from the Editor only... makes no sense :-(

About the ifdefs not being granular enough, I'll comment in the slack discussion but I'm not sure there's a clean solution.

Pauliusd01 commented 2 months ago

Couple of concerns from me:

  • I did not need these changes to fix the issue, simply opening the Editor version that has your latest changes is enough to fix it
  • The ifdefs for the code are not granular enough and I still get errors about missing Editor code on 6.0.6f1 Editor, should that be changed?

Also, please take a look at the slack discussion about this change in our input channel

You say you only need the Editor changes, are you sure there's no copy of my package fixes that survived in your Library folder? Otherwise I can't see how the InputSystemUIInputModule fixes could come from the Editor only... makes no sense :-(

It's the user project from ISXB-704 with no library and 1.8.2 input system

benoitalain commented 2 months ago

Couple of concerns from me:

  • I did not need these changes to fix the issue, simply opening the Editor version that has your latest changes is enough to fix it
  • The ifdefs for the code are not granular enough and I still get errors about missing Editor code on 6.0.6f1 Editor, should that be changed?

Also, please take a look at the slack discussion about this change in our input channel

You say you only need the Editor changes, are you sure there's no copy of my package fixes that survived in your Library folder? Otherwise I can't see how the InputSystemUIInputModule fixes could come from the Editor only... makes no sense :-(

It's the user project from ISXB-704 with no library and 1.8.2 input system

Hi! I've updated the PR description to emphasize the changes that this PR contains. It's not observable scroll range fixes in any of the UI systems, but just the option to allow InputSystem actions returning values in the -120 to 120 range.