Search Unity

Feedback Mouse.WarpCursorPosition() produces mouse delta on Linux but not on Windows?

Discussion in 'Input System' started by ashtorak, Apr 16, 2022.

  1. ashtorak

    ashtorak

    Joined:
    Feb 19, 2014
    Posts:
    53
    I am using the mouse delta event from the new input system. But apparently there is a small but important difference as it behaves different on Linux and Windows, producing a mouse delta on the former, but not the latter. At least in my case or is this system dependent? It's pretty much default Windows 10 and Ubuntu though.
    Is this also the reason why the mouse cursor is centered during cursor lock on Windows while it isn't on Linux?

    Would be nice, if this could be mentioned somewhere like here:
    https://docs.unity3d.com/Packages/com.unity.inputsystem@1.3/manual/Mouse.html

    Also this would be incorrect then or only apply to Windows:
    "Note: If the cursor is locked, warping the mouse position is only temporary and Unity resets the cursor to the center of the window every frame."
    At least it's not the case on my Ubuntu system as there the cursor is not in the center after unlocking.
     
  2. florianveltman

    florianveltman

    Joined:
    Sep 7, 2012
    Posts:
    27
    Just wanted to comment here as I am encountering the same issue with MacOS, and this thread comes up on Google when searching for this issue. I was getting some strange mouse delta readings and disabling the
    WarpCursorPosition()
    code fixed my mouse delta problems, which prompted me to search for this issue online.
    I hope to find a way of getting the Delta to work properly without
    WarpCursorPosition()
    affecting it.

    I don't know of the specifics on Linux, but on MacOS this isn't the case, so that might be a separate issue altogether.
     
    ashtorak likes this.
  3. ashtorak

    ashtorak

    Joined:
    Feb 19, 2014
    Posts:
    53
    Interesting. I cannot test Mac myself. But I would have expected that it behaves somewhat similar to Linux in that regard.
    What Unity version are you using?
    I am currently on 2022.2.0b3, but I am scared of updating as it broke the input system the last time I tried. Seems they are working on something bigger. But I don't know what exactly. I am not in the mood to look at it in more detail right now.
     
    florianveltman likes this.
  4. florianveltman

    florianveltman

    Joined:
    Sep 7, 2012
    Posts:
    27
    We're on 2022.1.6f1, we're fairly close to release so I'll look into updating later on as stability is the priority right now.
    Thanks for the thread and the additional information, I hope we'll find a workaround for this issue at some point.
     
    ashtorak likes this.