Skip to content

Commit 78e4e0e

Browse files
benoitalainduckets
andauthored
FIX: ISXB-704 scroll wheel support windows raw input value (#1946)
* Fixed ISXB-766, ISXB-808, ISXB-704, conditional to trunk PR #49932. * Updated for latest trunk PR changes (5f81a20). * Reverted fix for ISXB-808 and partly ISXB-766. Kept ISBX-704 fix. * Added scroll wheel normalization tests for UI and InputForUI. * Recommended changes from @ekcoh. Added more #if UNITY_6000_0_OR_NEWER. * Added missing #if UNITY_6000_0_OR_NEWER in InputForUITests * Added changes to CHANGELOG.md * Improved Scroll Wheel Delta UI tooltip text * Improved API docs for ScrollDeltaBehavior * fixed bad xml tag * Replaced UNITY_6000_0_OR_NEWER by asmdef versionDefines >= 6000.0.9 * Fixed missed #if replacement in UITests. * formatting --------- Co-authored-by: Ben Pitt <[email protected]>
1 parent 37d120e commit 78e4e0e

File tree

14 files changed

+208
-18
lines changed

14 files changed

+208
-18
lines changed

Assets/Tests/InputSystem/Plugins/InputForUITests.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using UnityEngine.InputForUI;
88
using UnityEngine.InputSystem;
99
using UnityEngine.InputSystem.Controls;
10+
using UnityEngine.InputSystem.LowLevel;
1011
#if UNITY_EDITOR
1112
using UnityEditor;
1213
using UnityEngine.InputSystem.Editor;
@@ -462,6 +463,8 @@ public void UIActionClick_FiresUIClickEvents_FromInputsMousePenAndTouch(bool use
462463
Assert.AreEqual(10, m_InputForUIEvents.Count);
463464
}
464465

466+
const float kScrollUGUIScaleFactor = 3.0f; // See InputSystemProvider OnScrollWheelPerformed() callback
467+
465468
[Test]
466469
[Category(kTestCategory)]
467470
[TestCase(true)]
@@ -475,7 +478,6 @@ public void UIActionScroll_FiresUIScrollEvents_FromInputMouse(bool useProjectWid
475478
}
476479
Update();
477480

478-
var kScrollUGUIScaleFactor = 3.0f; // See InputSystemProvider OnScrollWheelPerformed() callback
479481
var mouse = InputSystem.AddDevice<Mouse>();
480482
Update();
481483
// Make the minimum step of scroll delta to be ±1.0f
@@ -489,6 +491,31 @@ public void UIActionScroll_FiresUIScrollEvents_FromInputMouse(bool useProjectWid
489491
});
490492
}
491493

494+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
495+
[Category(kTestCategory)]
496+
[TestCase(1.0f)]
497+
[TestCase(120.0f)]
498+
public void UIActionScroll_ReceivesNormalizedScrollWheelDelta(float scrollWheelDeltaPerTick)
499+
{
500+
var mouse = InputSystem.AddDevice<Mouse>();
501+
Update();
502+
503+
// Set scroll delta with a custom range.
504+
((InputTestRuntime)InputRuntime.s_Instance).scrollWheelDeltaPerTick = scrollWheelDeltaPerTick;
505+
Set(mouse.scroll, new Vector2(0, scrollWheelDeltaPerTick));
506+
Update();
507+
508+
// UI should receive scroll delta in its expected range.
509+
Assert.AreEqual(1, m_InputForUIEvents.Count);
510+
Assert.That(GetNextRecordedUIEvent() is
511+
{
512+
type: Event.Type.PointerEvent,
513+
asPointerEvent: { type: PointerEvent.Type.Scroll, eventSource: EventSource.Mouse, scroll: {x: 0, y: -kScrollUGUIScaleFactor} }
514+
});
515+
}
516+
517+
#endif
518+
492519
#endregion
493520

494521
#if UNITY_EDITOR

Assets/Tests/InputSystem/Plugins/UITests.cs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
10371037
Assert.That(scene.rightChildReceiver.events[0].pointerData.pointerId, Is.EqualTo(pointerId));
10381038
Assert.That(scene.rightChildReceiver.events[0].pointerData.position, Is.EqualTo(thirdScreenPosition).Using(Vector2EqualityComparer.Instance));
10391039
Assert.That(scene.rightChildReceiver.events[0].pointerData.delta, Is.EqualTo(Vector2.zero));
1040-
Assert.That(scene.rightChildReceiver.events[0].pointerData.scrollDelta, Is.EqualTo(Vector2.one * (1 / InputSystemUIInputModule.kPixelPerLine)).Using(Vector2EqualityComparer.Instance));
1040+
Assert.That(scene.rightChildReceiver.events[0].pointerData.scrollDelta, Is.EqualTo(Vector2.one).Using(Vector2EqualityComparer.Instance));
10411041
Assert.That(scene.rightChildReceiver.events[0].pointerData.pointerEnter, Is.SameAs(scene.rightGameObject));
10421042
Assert.That(scene.rightChildReceiver.events[0].pointerData.pointerDrag, Is.Null);
10431043
Assert.That(scene.rightChildReceiver.events[0].pointerData.pointerPress, Is.Null);
@@ -1174,6 +1174,45 @@ public IEnumerator UI_CanReceivePointerExitsWhenChangingUIStateWithoutMovingPoin
11741174
);
11751175
}
11761176

1177+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
1178+
[UnityTest]
1179+
[Category("UI")]
1180+
[TestCase(1.0f, ExpectedResult = -1)]
1181+
[TestCase(120.0f, ExpectedResult = -1)]
1182+
public IEnumerator UI_ReceivesNormalizedScrollWheelDelta(float scrollWheelDeltaPerTick)
1183+
{
1184+
var mouse = InputSystem.AddDevice<Mouse>();
1185+
var scene = CreateTestUI();
1186+
var actions = new DefaultInputActions();
1187+
scene.uiModule.point = InputActionReference.Create(actions.UI.Point);
1188+
scene.uiModule.scrollWheel = InputActionReference.Create(actions.UI.ScrollWheel);
1189+
1190+
Set(mouse.position, scene.From640x480ToScreen(100, 100));
1191+
Set(mouse.scroll, Vector2.zero);
1192+
1193+
yield return null;
1194+
1195+
Assert.That(scene.eventSystem.IsPointerOverGameObject(), Is.True);
1196+
1197+
scene.leftChildReceiver.events.Clear();
1198+
1199+
// Set scroll delta with a custom range.
1200+
((InputTestRuntime)InputRuntime.s_Instance).scrollWheelDeltaPerTick = scrollWheelDeltaPerTick;
1201+
Set(mouse.scroll, new Vector2(0, scrollWheelDeltaPerTick));
1202+
yield return null;
1203+
1204+
// UI should receive scroll delta in the [-1, 1] range.
1205+
Assert.That(scene.leftChildReceiver.events,
1206+
EventSequence(
1207+
OneEvent("type", EventType.Scroll),
1208+
AllEvents("position", scene.From640x480ToScreen(100, 100)),
1209+
AllEvents("scrollDelta", Vector2.up)
1210+
)
1211+
);
1212+
}
1213+
1214+
#endif
1215+
11771216
[UnityTest]
11781217
[Category("UI")]
11791218
[TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = -1)]

Assets/Tests/InputSystem/Unity.InputSystem.Tests.asmdef

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
"name": "Unity",
4646
"expression": "2022.3",
4747
"define": "UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS"
48+
},
49+
{
50+
"name": "Unity",
51+
"expression": "6000.0.9",
52+
"define": "UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA"
4853
}
4954
],
5055
"noEngineReferences": false

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ however, it has to be formatted properly to pass verification tests.
1010

1111
## [Unreleased] - yyyy-mm-dd
1212

13-
### Change
13+
### Changed
1414
- Added warning messages to both `OnScreenStick` and `OnScreenButton` Inspector editors that would display a warning message in case on-screen control components are added to a `GameObject` not part of a valid UI hierarchy.
1515
- Changed behavior for internal feature flag relating to Windows Gaming Input to be ignored on non-supported platforms.
16+
- Changed `DualSenseHIDInputReport` from internal to public visibility
1617

1718
### Fixed
1819
- Avoid potential crashes from `NullReferenceException` in `FireStateChangeNotifications`.
@@ -23,6 +24,7 @@ however, it has to be formatted properly to pass verification tests.
2324
- Fixed error thrown when Cancelling Control Scheme creation in Input Actions Editor.
2425
- Fixed Scheme Name in Control Scheme editor menu that gets reset when editing devices [ISXB-763](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-763).
2526
- Fixed an issue where `InputActionAsset.FindAction(string, bool)` would throw `System.NullReferenceException` instead of returning `null` if searching for a non-existent action with an explicit action path and using `throwIfNotFound: false`, e.g. searching for "Map/Action" when `InputActionMap` "Map" exists but no `InputAction` named "Action" exists within that map [ISXB-895](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-895).
27+
- Fixed scroll speed being slower when using InputSystemUIInputModule instead of StandaloneInputModule. (https://jira.unity3d.com/browse/ISXB-771)
2628
- Fixed an issue where adding a `OnScreenButton` or `OnScreenStick` to a regular GameObject would lead to exception in editor.
2729
- Fixed an issue where adding a `OnScreenStick` to a regular GameObject and entering play-mode would lead to exceptions being generated.
2830
- Fixed InputActionReference issues when domain reloads are disabled [ISXB-601](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-601), [ISXB-718](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-718), [ISXB-900](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-900)
@@ -32,16 +34,13 @@ however, it has to be formatted properly to pass verification tests.
3234
- Submit and Cancel UI actions will now respect configured interactions. [ISXB-841](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-841).
3335
- Fixed the UI generation of enum fields when editing interactions of action properties. The new selected value was lost when saving.
3436
- Fixed the UI generation of custom interactions of action properties when it rely on OnGUI callback. [ISXB-886](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-886).
35-
37+
- Fixed deletion of last composite part raising an exception. [ISXB-804](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-804)
3638

3739
### Added
3840
- Added additional device information when logging the error due to exceeding the maximum number of events processed
3941
set by `InputSystem.settings.maxEventsBytesPerUpdate`. This additional information is available in development builds
4042
only.
41-
- Fixed deletion of last composite part raising an exception. [ISXB-804](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-804)
42-
43-
### Changed
44-
- Changed `DualSenseHIDInputReport` from internal to public visibility
43+
- Added Input Setting option allowing to keep platform-specific scroll wheel input values instead of automatically converting them to a normalized range.
4544

4645
## [1.8.2] - 2024-04-29
4746

Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ public override void OnGUI(string searchContext)
122122
if (!runInBackground)
123123
EditorGUILayout.HelpBox("Focus change behavior can only be changed if 'Run In Background' is enabled in Player Settings.", MessageType.Info);
124124

125+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
126+
EditorGUILayout.PropertyField(m_ScrollDeltaBehavior, m_ScrollDeltaBehaviorContent);
127+
#endif
128+
125129
EditorGUILayout.Space();
126130
EditorGUILayout.PropertyField(m_CompensateForScreenOrientation, m_CompensateForScreenOrientationContent);
127131

@@ -266,6 +270,7 @@ private void InitializeWithCurrentSettings()
266270
// Look up properties.
267271
m_SettingsObject = new SerializedObject(m_Settings);
268272
m_UpdateMode = m_SettingsObject.FindProperty("m_UpdateMode");
273+
m_ScrollDeltaBehavior = m_SettingsObject.FindProperty("m_ScrollDeltaBehavior");
269274
m_CompensateForScreenOrientation = m_SettingsObject.FindProperty("m_CompensateForScreenOrientation");
270275
m_BackgroundBehavior = m_SettingsObject.FindProperty("m_BackgroundBehavior");
271276
m_EditorInputBehaviorInPlayMode = m_SettingsObject.FindProperty("m_EditorInputBehaviorInPlayMode");
@@ -281,6 +286,9 @@ private void InitializeWithCurrentSettings()
281286
m_ShortcutKeysConsumeInputs = m_SettingsObject.FindProperty("m_ShortcutKeysConsumeInputs");
282287

283288
m_UpdateModeContent = new GUIContent("Update Mode", "When should the Input System be updated?");
289+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
290+
m_ScrollDeltaBehaviorContent = new GUIContent("Scroll Delta Behavior", "Controls whether the value returned by the Scroll Wheel Delta is normalized (to be uniform across all platforms), or returns the non-normalized platform-specific range which can vary between platforms.");
291+
#endif
284292
m_CompensateForScreenOrientationContent = new GUIContent("Compensate Orientation", "Whether sensor input on mobile devices should be transformed to be relative to the current device orientation.");
285293
m_BackgroundBehaviorContent = new GUIContent("Background Behavior", "If runInBackground is true (and in standalone *development* players and the editor), "
286294
+ "determines what happens to InputDevices and events when the application moves in and out of running in the foreground.\n\n"
@@ -404,6 +412,7 @@ private static string[] FindInputSettingsInProject()
404412
[NonSerialized] private int m_SettingsDirtyCount;
405413
[NonSerialized] private SerializedObject m_SettingsObject;
406414
[NonSerialized] private SerializedProperty m_UpdateMode;
415+
[NonSerialized] private SerializedProperty m_ScrollDeltaBehavior;
407416
[NonSerialized] private SerializedProperty m_CompensateForScreenOrientation;
408417
[NonSerialized] private SerializedProperty m_BackgroundBehavior;
409418
[NonSerialized] private SerializedProperty m_EditorInputBehaviorInPlayMode;
@@ -427,6 +436,9 @@ private static string[] FindInputSettingsInProject()
427436
[NonSerialized] private GUIStyle m_NewAssetButtonStyle;
428437

429438
private GUIContent m_UpdateModeContent;
439+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
440+
private GUIContent m_ScrollDeltaBehaviorContent;
441+
#endif
430442
private GUIContent m_CompensateForScreenOrientationContent;
431443
private GUIContent m_BackgroundBehaviorContent;
432444
private GUIContent m_EditorInputBehaviorInPlayModeContent;

Packages/com.unity.inputsystem/InputSystem/IInputRuntime.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ internal unsafe interface IInputRuntime
175175
Vector2 screenSize { get; }
176176
ScreenOrientation screenOrientation { get; }
177177

178+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
179+
bool normalizeScrollWheelDelta { get; set; }
180+
float scrollWheelDeltaPerTick { get; }
181+
#endif
182+
178183
// If analytics are enabled, the runtime receives analytics events from the input manager.
179184
// See InputAnalytics.
180185
#if UNITY_ANALYTICS || UNITY_EDITOR

Packages/com.unity.inputsystem/InputSystem/InputManager.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,23 @@ public InputUpdateType defaultUpdateType
161161
}
162162
}
163163

164+
public InputSettings.ScrollDeltaBehavior scrollDeltaBehavior
165+
{
166+
get => m_ScrollDeltaBehavior;
167+
set
168+
{
169+
if (m_ScrollDeltaBehavior == value)
170+
return;
171+
172+
m_ScrollDeltaBehavior = value;
173+
174+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
175+
InputRuntime.s_Instance.normalizeScrollWheelDelta =
176+
m_ScrollDeltaBehavior == InputSettings.ScrollDeltaBehavior.UniformAcrossAllPlatforms;
177+
#endif
178+
}
179+
}
180+
164181
public float pollingFrequency
165182
{
166183
get => m_PollingFrequency;
@@ -1853,6 +1870,8 @@ internal void InitializeData()
18531870
m_UpdateMask |= InputUpdateType.Editor;
18541871
#endif
18551872

1873+
m_ScrollDeltaBehavior = InputSettings.ScrollDeltaBehavior.UniformAcrossAllPlatforms;
1874+
18561875
// Default polling frequency is 60 Hz.
18571876
m_PollingFrequency = 60;
18581877

@@ -2069,6 +2088,8 @@ internal struct AvailableDevice
20692088
private InputUpdateType m_CurrentUpdate;
20702089
internal InputStateBuffers m_StateBuffers;
20712090

2091+
private InputSettings.ScrollDeltaBehavior m_ScrollDeltaBehavior;
2092+
20722093
#if UNITY_EDITOR
20732094
// remember time offset to correctly restore it after editor mode is done
20742095
private double latestNonEditorTimeOffsetToRealtimeSinceStartup;
@@ -2625,6 +2646,8 @@ internal void ApplySettings()
26252646
#endif
26262647
updateMask = newUpdateMask;
26272648

2649+
scrollDeltaBehavior = m_Settings.scrollDeltaBehavior;
2650+
26282651
////TODO: optimize this so that we don't repeatedly recreate state if we add/remove multiple devices
26292652
//// (same goes for not resolving actions repeatedly)
26302653

@@ -3879,6 +3902,7 @@ internal struct SerializedState
38793902
public InputStateBuffers buffers;
38803903
public InputUpdate.SerializedState updateState;
38813904
public InputUpdateType updateMask;
3905+
public InputSettings.ScrollDeltaBehavior scrollDeltaBehavior;
38823906
public InputMetrics metrics;
38833907
public InputSettings settings;
38843908
public InputActionAsset actions;
@@ -3923,6 +3947,7 @@ internal SerializedState SaveState()
39233947
buffers = m_StateBuffers,
39243948
updateState = InputUpdate.Save(),
39253949
updateMask = m_UpdateMask,
3950+
scrollDeltaBehavior = m_ScrollDeltaBehavior,
39263951
metrics = m_Metrics,
39273952
settings = m_Settings,
39283953
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
@@ -3940,6 +3965,7 @@ internal void RestoreStateWithoutDevices(SerializedState state)
39403965
m_StateBuffers = state.buffers;
39413966
m_LayoutRegistrationVersion = state.layoutRegistrationVersion + 1;
39423967
updateMask = state.updateMask;
3968+
scrollDeltaBehavior = state.scrollDeltaBehavior;
39433969
m_Metrics = state.metrics;
39443970
m_PollingFrequency = state.pollingFrequency;
39453971

Packages/com.unity.inputsystem/InputSystem/InputSettings.cs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,28 @@ public UpdateMode updateMode
8484
}
8585
}
8686

87+
/// <summary>
88+
/// Controls how platform-specific input should be converted when returning delta values for scroll wheel input actions.
89+
/// </summary>
90+
/// <value>The conversion behavior.</value>
91+
/// <remarks>
92+
/// By default, the range used for the delta is normalized to a range of -1 to 1, to be uniform across all platforms.
93+
/// The alternative is that the native platform's scroll wheel range is returned, which is -120 to 120 for windows, and
94+
/// -1 to 1 for most other platforms. You should leave this value as the default uniform range unless you need to support
95+
/// legacy code that relies on the native platform-specific values.
96+
/// </remarks>
97+
public ScrollDeltaBehavior scrollDeltaBehavior
98+
{
99+
get => m_ScrollDeltaBehavior;
100+
set
101+
{
102+
if (m_ScrollDeltaBehavior == value)
103+
return;
104+
m_ScrollDeltaBehavior = value;
105+
OnChange();
106+
}
107+
}
108+
87109
/// <summary>
88110
/// If true, sensors that deliver rotation values on handheld devices will automatically adjust
89111
/// rotations when the screen orientation changes.
@@ -734,6 +756,7 @@ public void SetInternalFeatureFlag(string featureName, bool enabled)
734756
[Tooltip("Determine when Unity processes events. By default, accumulated input events are flushed out before each fixed update and "
735757
+ "before each dynamic update. This setting can be used to restrict event processing to only where the application needs it.")]
736758
[SerializeField] private UpdateMode m_UpdateMode = UpdateMode.ProcessEventsInDynamicUpdate;
759+
[SerializeField] private ScrollDeltaBehavior m_ScrollDeltaBehavior = ScrollDeltaBehavior.UniformAcrossAllPlatforms;
737760
[SerializeField] private int m_MaxEventBytesPerUpdate = 5 * 1024 * 1024;
738761
[SerializeField] private int m_MaxQueuedEventsPerUpdate = 1000;
739762

@@ -826,6 +849,29 @@ public enum UpdateMode
826849
ProcessEventsManually,
827850
}
828851

852+
/// <summary>
853+
/// How platform-specific input should be converted when returning delta values for scroll wheel input actions.
854+
/// </summary>
855+
public enum ScrollDeltaBehavior
856+
{
857+
/// <summary>
858+
/// The range used for the delta is converted to be uniform across all platforms.
859+
/// </summary>
860+
/// <remarks>
861+
/// The resulting range will be [-1, 1] regardless of the platform used.
862+
/// </remarks>
863+
UniformAcrossAllPlatforms = 0,
864+
865+
/// <summary>
866+
/// The range used for the delta is the same as returned by the platform input.
867+
/// </summary>
868+
/// <remarks>
869+
/// The range will typically be [-120, 120] on Windows and [-1, 1] on MacOS and Linux.
870+
/// Other platforms may have different ranges.
871+
/// </remarks>
872+
KeepPlatformSpecificInputRange = 1
873+
}
874+
829875
/// <summary>
830876
/// Determines how the applications behaves when running in the background. See <see cref="backgroundBehavior"/>.
831877
/// </summary>

Packages/com.unity.inputsystem/InputSystem/InputSystem.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3423,6 +3423,12 @@ public static bool runInBackground
34233423
set => s_Manager.m_Runtime.runInBackground = value;
34243424
}
34253425

3426+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
3427+
internal static float scrollWheelDeltaPerTick => InputRuntime.s_Instance.scrollWheelDeltaPerTick;
3428+
#else
3429+
internal const float scrollWheelDeltaPerTick = 1.0f;
3430+
#endif
3431+
34263432
////REVIEW: restrict metrics to editor and development builds?
34273433
/// <summary>
34283434
/// Get various up-to-date metrics about the input system.

Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,19 @@ private void OnFocusChanged(bool focus)
281281
public Vector2 screenSize => new Vector2(Screen.width, Screen.height);
282282
public ScreenOrientation screenOrientation => Screen.orientation;
283283

284+
#if UNITY_INPUT_SYSTEM_PLATFORM_SCROLL_DELTA
285+
public bool normalizeScrollWheelDelta
286+
{
287+
get => NativeInputSystem.normalizeScrollWheelDelta;
288+
set => NativeInputSystem.normalizeScrollWheelDelta = value;
289+
}
290+
291+
public float scrollWheelDeltaPerTick
292+
{
293+
get => NativeInputSystem.GetScrollWheelDeltaPerTick();
294+
}
295+
#endif
296+
284297
public bool isInBatchMode => Application.isBatchMode;
285298

286299
#if UNITY_EDITOR

0 commit comments

Comments
 (0)