Input does't work at all for me

I have am trying this code with default input manager settings. It is attached to a game object with no other components in scene. Its Camera field is setted to default camera in the scene. Each input function returns false/0 no matter what I try. Even Input.anyKeyDown never returns true.

    public class KeyboardController : MonoBehaviour
    {
        public float YMin = -100;
        public float YMax = 100;
        public float XMin = -100;
        public float XMax = -100;

        public float XSpeed = 1;
        public float YSpeed = 1;

        public float MouseXSpeed = 1;
        public float MouseYSpeed = 1;

        public GameObject Camera;

        public void Update()
        {
            var pos = Camera.transform.position;
            var x = pos.x;
            var y = pos.y;

            if (Input.GetKeyDown(KeyCode.Mouse1))
            {
                x += MouseXSpeed * Time.deltaTime * Input.GetAxis("Mouse X");
                y += MouseYSpeed * Time.deltaTime * Input.GetAxis("Mouse Y");
            }
            else
            {
                x += XSpeed * Time.deltaTime * Input.GetAxis("Horizontal");
                y += YSpeed * Time.deltaTime * Input.GetAxis("Vertical");
            }

            if (x < XMin)
                x = XMin;
            else if (x > XMax)
                x = XMax;

            if (y < YMin)
                y = YMin;
            else if (y > YMax)
                y = YMax;

            Camera.transform.position.Set(x, y, pos.z);
        }
    }

KeyCode.Mouse1 refers to the secondary mouse button which in most cases is the right mouse button.

But if using Input.GetKeyDown(KeyCode.Mouse0) (left) / Input.GetKeyDown(KeyCode.Mouse1) (right) is not working for you then I would suggest using

Input.GetButtonDown("Fire1"); (Left)

or

Input.GetButtonDown("Fire2"); (Right)

Also do you always want to be falling into the else block if mouse is not pressed?