Relative mouse\gamepad position with New Input System

Hi there, I’m trying to implement look around feature with mouse/gamepad stick so I faced a problem that I can’t solve myself.

When I read Vector2 from gamepad’s stick, its values are between -1 and 1, which is okay for me.
But the mouse position behaves different, it goes from 0 to screen size.

And I need to be 0,0 when pointer is in center of the screen and from -1 to 1 from side to side.

So, the question is, how do I config my input controls (or any other way) to get consistent values from gamepad and mouse?

The only idea I got is to use inverse lerp with offset, but I don’t know how to do that only for mouse and, to be honest, it feels like a bad solution. I’m sure new input system is powerful enough to handle this.

Thanks!

Ended up with custom input processor.

using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;

#if UNITY_EDITOR
[InitializeOnLoad]
#endif
public class MouseRelativeToScreenInputProcessor : InputProcessor<Vector2> {
   
#if UNITY_EDITOR
    static MouseRelativeToScreenInputProcessor()
    {
        Initialize();
    }
#endif

    [RuntimeInitializeOnLoadMethod]
    static void Initialize() {
        InputSystem.RegisterProcessor<MouseRelativeToScreenInputProcessor>();
    }

    //...
    public override Vector2 Process(Vector2 value, InputControl control) {
        float x = (Mathf.InverseLerp(0, Screen.width, value.x) - 0.5f) * 2;
        float y = (Mathf.InverseLerp( 0, Screen.height, value.y) - 0.5f) * 2;
       
        return new Vector2(x, y);
    }
}

Probably logic might be better, open of suggestions.