Detect whether the mouse button is pressed or released using the MouseButtonState property.