Either way would work. When I'm cutting my own keyways I use a center-cutting round milling cutter, and make a plunge cut without extending the keyway all the way to the end of the shaft. Then I radius the ends of the key to match the shape of the slot, and the key retains itself. Obviously, with a shaft that's slotted all the way, that's not an option. Another trick is to use a setscrew with a cone point, and drill a dimple in the key for the point to fit into. That doesn't work on a sliding yoke, however.
Jerry