This line is bogus. Capture is released by releasing the mouse pointer, not by pressing the button. Thus the button text should not have been changed to "Release Capture", and should not need to be changed back to "Set Capture" here.