Flintlocks lasted a remarkably long time, but they were eventually replaced by a lock and ignition system called the percussion cap. The percussion cap was easier to load, more weather resistant and more reliable, so by the time of America's civil war, both Union and Confederate armies used percussion-cap guns exclusively.
The percussion cap was made possible by the discovery of a chemical compound called mercuric fulminate or fulminate of mercury. Its chemical formula is Hg(ONC)2 -- it is made from mercury, nitric acid and alcohol.
Mercuric fulminate is extremely explosive, and it is shock sensitive. A sharp blow, or even too much finger pressure, can cause it to detonate. By putting a small amount of mercuric fulminate in a pre-made cap (a tiny cup about the size of a pencil eraser) and affixing the cap to a nipple and tube leading into the barrel, the cap can ignite the gunpowder in the barrel.
The transition from flintlock to percussion cap is very minor, and many flintlocks were converted. The percussion lock is exactly the same as the flintlock in terms of the mainspring, hammer, tumbler, sear and sear spring. The hammer has uncocked, half-cocked and fully cocked positions just like the flintlock.
What the percussion lock does not have is the flint and frizzen. Instead, there is a nipple that accepts the cap, and this nipple contains a tube that leads the flame from the cap down to the main charge of gunpowder in the barrel. The hammer is shaped to strike the cap on the nipple and cover it so the nipple does not get blown off. These pictures help you understand the percussion lock:
The percussion lock did not last very long -- perhaps 50 years. Manufacturing processes were developing rapidly at the time and it became possible to integrate the cap, powder and projectile into a single metal package at low cost. These bullets are what we use today!
For lots more information on flintlock guns and other weapons, check out the links on the next page.