Endless touch with new input system

So Im starting to work with new input system and failed with first task - detect touch coordinates. Im able to detect only first mouse click as touch, but after mouse button released, touch is not. So next attempts to click on the game screen just getting ignored(even at real device). But in case next game click performed after another click which was performed out of unity editor game window - ‘started’ and ‘performed’ events will trigger again

My action:


My code(simple logging to understand what is going):

    void Awake()
    {
        playerCharacterControl = new PlayerCharacterControl();
    }

    void OnEnable()
    {
        playerCharacterControl.Enable();
    }

    void OnDisable()
    {
        playerCharacterControl.Disable();
    }

    void Start()
    {
        playerCharacterControl.Touch.Touch.started += ctx => DetectTouchCoordinates(ctx);
        playerCharacterControl.Touch.Touch.performed += ctx => PerformedLogs();
        playerCharacterControl.Touch.Touch.canceled += ctx => CanceledLogs();
    }

    void DetectTouchCoordinates(InputAction.CallbackContext ctx) {
        posText.text = ctx.action.ReadValue<Vector2>().ToString();
        Debug.Log("STARTED " + ctx.action.ReadValue<Vector2>());
    }

    void PerformedLogs() {
        Debug.Log("PERFORMED");
    }
    void CanceledLogs() {
        Debug.Log("CANCELED");
    } 

Do you have any advices how to register touch end properly?

My workaround is combination of Button action and Value action to call it when listening first action.

void Start()
    {
        playerCharacterControl.Touch.TouchPress.started += ctx => DetectTouchCoordinates(ctx);
        playerCharacterControl.Touch.TouchPress.canceled += ctx => CanceledTouch(ctx);
    }

void DetectTouchCoordinates(InputAction.CallbackContext ctx) {
        Debug.Log("CLICK COORDINATES " + playerCharacterControl.Touch.TouchPosition.ReadValue<Vector2>());
    }

In this case with listening to Button action started and canceled events are triggered as expected

I have the same problem except I allow multiple input controllers (e.g., mouse, touch, XR). The only way I can find to get coordinates from an input is from input-specific nodes. I’d have to somehow use a Switch statement to check what input device is being used then call the correct function for that input device to get coordinates.

I built the same workaround as you did but ditched it because I couldn’t figure out how to detect the input device. I think I’ve figured that part out now, but it’s such a hokey workaround for what appears to be a bug.

To make matters more fun, I’m using Visual Scripting. It results in the same behavior, though. Getting Button inputs work every time. Getting Vector 2 inputs only work once unless you click outside of the game window. Then it works once again.

I’ve tried every combination I can think of for the Input System settings: Action Types, Control Types, Bindings, Interactions, node settings, etc.

I’ve been coming back to this problem for a few weeks. I can’t find anything on YouTube or the regular forums. Muse Chat hasn’t been helpful.