A violent confrontation with a machete-wielding South Florida man ended with an officer's gun going off at a condominium complex in Highland Beach.