Based on a picture found on Google Images.
Two gears, same size, with different slot guides;
The first moves the hammer from one position to another;
The second moves the hammer down and up.
Modeled with Solidworks 2015.
Rendered with Simlab Composer 6 Mechanical Edition.
Video at https://youtu.be/qXpPxKo2tBA.