Skip to content

Commit 9ab25ab

Browse files
DOCS: Specifying mouse position and delta behaviour (#2028)
* Added documentation in Mouse.cs to specify the independent behaviour between position and delta. This is to help clarify ISXB-819 * Adjusted mouse.cs positions and delta documentation. * doc amendments Moved new docs to <remarks> section, and improved wording. --------- Co-authored-by: Ben Pitt <[email protected]>
1 parent 6331849 commit 9ab25ab

File tree

1 file changed

+8
-0
lines changed
  • Packages/com.unity.inputsystem/InputSystem/Devices

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public struct MouseState : IInputStateTypeInfo
2626
/// Screen-space position of the mouse in pixels.
2727
/// </summary>
2828
/// <value>Position of mouse on screen.</value>
29+
/// <remarks>
30+
/// On Windows, delta originates from RAWINPUT API.
31+
/// Note: This value might not update every frame, particularly if your project is running at a high frame rates. This value might also update at a different time than the <see cref="Pointer.delta"/>. If you need a delta value that correlates with position, you should compute it based on the previous position value.
32+
/// </remarks>
2933
/// <seealso cref="Pointer.position"/>
3034
[InputControl(usage = "Point", dontReset = true)] // Mouse should stay put when we reset devices.
3135
[FieldOffset(0)]
@@ -35,6 +39,10 @@ public struct MouseState : IInputStateTypeInfo
3539
/// Screen-space motion delta of the mouse in pixels.
3640
/// </summary>
3741
/// <value>Mouse movement.</value>
42+
/// <remarks>
43+
/// On Windows, delta originates from RAWINPUT API.
44+
/// Note: This value might not update every frame, particularly if your project is running at a high frame rates. This value might also update at a different time than the <see cref="Pointer.position"/>. If you need a delta value that correlates with position, you should compute it based on the previous position value.
45+
/// </remarks>
3846
/// <seealso cref="Pointer.delta"/>
3947
[InputControl(usage = "Secondary2DMotion", layout = "Delta")]
4048
[FieldOffset(8)]

0 commit comments

Comments
 (0)