Hi all,
Using the InputSystem version 1.3.0 (Unity version 2022.1.6f1), I encounter a problem using Mouse.current.WarpCursorPosition(targetPosition);.
The way the cursor’s position is updated varies between MacOS and Windows.
On Windows, the cursor does move properly and everything is running as intended, however on MacOS, the cursor is only warping after moving the mouse.
I have set up this little example script to test the problem:
private void Update()
{
if (Mouse.current.leftButton.wasReleasedThisFrame)
{
Vector2 position = Mouse.current.position.ReadValue();
Vector2 mirrorPosition = new Vector2(Screen.width - position.x, Screen.height - position.y);
Mouse.current.WarpCursorPosition(mirrorPosition);
Debug.Log($"warping mouse from {position} to {mirrorPosition}.");
}
}
When running the script on Windows, the cursor warps to a mirrored screen position from where the user has clicked. Clicking a second time without moving the mouse warps the cursor again, back to the original screen position.
On MacOS however, the cursor does warp to the new position, but if the user clicks again without moving the mouse, the Debug.Log message shows that the cursor’s position has not been updated. Visually, the mouse doesn’t appear to move at all.
After googling for answers, I came across the use of InputState.Change(Mouse.current.position, targetPosition);, which I think helps with my implementation but doesn’t help to circumvent the issue highlighted by the above example script.
I am looking to have a feature parity between Windows and MacOS, and hope to find a way to force update the cursor’s position so that I can use the WarpCursorPosition() function the same way across platforms.
Any help or tips getting this to work are very welcome!

