You can find this sample in the tutorial project: Menu → Mouse input
This C# Beginner tutorial covers how to handle mouse input.
We can check for the existence of a mouse and then we can use various methods to check if a mouse buttons are clicked, held down or released.
We can also check for the mouse wheel (middle mouse) being clicked. We can use the mouse wheel delta to determine if the mouse wheel has been scrolled in a frame.
And finally we learn how to use the absolute mouse position to draw text at the position of the mouse on the screen.
[!code-csharpEntity]