In double-action revolvers, the hammer is automatically pulled back and released on the primer charge after the trigger is pulled.
In single-action revolvers, the hammer has to be pulled back manually to turn the cylinder.
The firing hammer in muskets had to be pulled back after proper loading to the mechanism's parts, (which gunlock determines the parts the hammer hits). Then after the trigger was pulled, the hammer would hit the parts. With matchlocks, the hammer with a burning wick is lowered into the flash pan, with wheellocks the hammer (with flint) strikes a rotating wheel and creates sparks, with flintlocks the hammer (with flint) would hit the frizzen and create sparks, with caplocks, the hammer would hit the percussion cap on the opening to the inside of the barrel.
In semi-automatic rifles and automatic riflesEdit
The hammer is located inside the receiver and when released, strikes a firing pin that is inside the bolt carrier. The bolt carrier assembly then cycles back, cocking the hammer back in the process. In a semi-automatic rifle, the hammer is caught by a sear and not released until the trigger is pulled again. In an automatic weapon, the hammer is caught by an auto sear, which releases the hammer when the bolt carrier is completely forward and the bolt is in battery, firing the weapon as long as the trigger is held down.