Factor out code that fires the captureEvent.