How to get all mouse clicks from EventSystem without clicking on a Collider?

I want to use the EventSystem to detect a Click and Drag and use it to rotate the camera. I’ve added a OnDrag() but I have to assign that script to a GameObject with a collider on it in order for the EventSystem to react to it. I want the script on the camera and I want it to react to all Click and Drag events, even when clicking in empty space, how do I do that?

Implement pointer handler interfaces in your script and make sure everything you want to interact with when clicking has some sort of raycaster.

Hi KristofferH ,
A solution would be to use directly the Input class to detect when your mouse button is pressed and realesed, and then do whatever you want between those 2 events :

using UnityEngine;

public class MouseDetector : MonoBehaviour
{
    bool isDraging;

	void Update ()
    {
        if (Input.GetMouseButtonDown(0)) //return true when the user presses the mouse  button
            OnDrag();

        if (Input.GetMouseButtonUp(0)) //return true when the user releases the mouse  button
            OnDrop();

        if (isDraging)
        {
            //update here your camera position/rotation according to Input.mousePosition            
        }
    }

    void OnDrag()
    {
        isDraging = true;
        Debug.Log("Drag&Drop starts");
    }

    void OnDrop()
    {
        isDraging = false;
        Debug.Log("Drag&Drop ends");
    }
}