I hope this clears up any confusion. The shaft is sold with the "slotted out" side. The key is a small piece of metal (usually only as long as the thickness of the sprocket or gear hub) that fits in the slot and portrudes up into the keyway (slot) in the sprocket. Keys can be bought in key stock (long piece) or cut and precision ground into keys of predetermined length.
You can check out the "power transmission" section near the bottom left of the
www.mcmaster.com homepage.
here's a pic of a keyed shaft