The figure shows a gear wheel with a notch whose dimensions match that of the shear key which is inserted into a slot that is cut onto the shaft.
 

The gear is made with a notch that is the same width as the shear key.