Detect mouse click anywhere on the screen using New Input System

Hi, I am currently trying to implement a context menu that pops up next to the user’s cursor when the user clicks an item, similar to when you right click in most other applications. It doesn’t seem like Unity has a built-in component for this. This context menu should then disappear if the user clicks anywhere, whether on the menu or not.

There is a way to do it in the old input system Basic Mouse Click Anywhere for something to happen. - Questions & Answers - Unity Discussions but it doesn’t work for the new input system.

If there’s no easy way to do this, I will use a hacky idea inspired by another post I read: A giant invisible button that appears right behind the context menu, which can detect the click. But that would be a weird way to do this especially for something that seems like a trivial and common use case.

@MaxLohMusic Sorry for the late reply, but why don’t you just change your input system to both the old and new input system?