If the loading direction changes, like going from accelerating to decelerating in a go-kart keys and pins can both beat out unless fitted perfectly. Tapering the shaft and hub (like a lawnmower flywheel) increases reliability. Machining is difficult though. The two piece hubs which tighten on a non tapered shaft like the collet chuck in a die grinder work very well, you get both key and clamping. Relatively expensive though. If you heat the sprocket and chill the shaft you can assemble interferance fits with little trouble. I believe up to .001 inch per inch of shaft diameter if the temperature split is large enough. When the temperature evens out the assembly is very reliable. Disadvantage is that careful machining is required.
Want to say what you're building just to satisfy the curious?
Bill