As a 26 yr veteran machinist I would never take a file to a hub, sprocket etc. File the key and make it offset(2 different sizes).
Keys are cheap other parts are not..there are tolerances for making parts and keys are cheap parts,
If key fits in axle tight, push key in and lightly spray paint (or use dykem) key sticking out, scratch it with a pointy stick/nail etc to scribe it, now you can remove key and file off the painted/dyed areas.
Keys wear out from slop, beating back and forth as parts try to twist/rotate on shaft. We typical hold from +/- .001 on slow, lightweight part assembles to +/-.0005 on critical parts.
Sorry for hijack op, but if you open up hub too much to fit a key. Next key could ruin hub.
Bansil...jumps down from soapbox