A small square length of metal called a shear key is used to keep the gear from rotating relative to the shaft.