The percussion cap mechanism was the next great improvement in firearms. It was also called a caplock. The percussion cap was based on the discovery of fulminate of mercury in about 1800. When struck with a sharp blow, mercury fulminate detonates. In 1816, Joshua Shaw, an artist living in Philadelphia, painted fulminate of mercury on the inside of copper caps. He fitted it over a small nipple on the firing hole over the bore. When the hammer struck the percussion cap, the gun fired. By 1826 they were widely used and had replaced the flintlock.