I was working on my computer and I lifted my mouse and rotated it. Light from the tube light which was 2-3 meters away from my mouse fell on the mouse sensor, the cursor started moving as if I shook the mouse. It also worked with a torch. My knowledge says that mouse uses the red light from mouse diode for capturing images. So how this work? Or my knowledge is incomplete?
The mouse camera has a lens that is extremely near-sighted - its focus is mere millimeters: it is looking at small details of the surface you're scanning. How those details move from frame-to-frame give the motion result that is given back to your computer.
When you move the mouse away from the surface, it sees an image so extremely blurred that no details are available for its image processing. It can see light, but it appears the same brightness for every pixel in its tiny frame. No motion is detected.
Any light source can cast a shadow (perhaps from the edge of the mouse's shell bottom where the camera opening resides). As this shadow moves across the frame, your mouse may momentarily see it as a "detail-that-moves" and detect that as motion.
There is really nothing special about the red LED light source in the mouse. It is just a steady source of light to illuminate the surface where the camera is looking. It might change intensity to adapt to surfaces of different reflectivity.