I made a Slotting Attachment using the College Engineering Supply casting. (It came with a reprint of the article by, the now late, Peter Robinson. He was a member of the Peterborough Society of Model Engineers)
Once the base had been machined, mounting it on the Cross Slide of the Myford, allowed the bore for the Ram to be machined. When the Myford was sold, made a riser block to adapt it to my BL12/24.
When a one off square socket (for a speedo drive adaptor for a scooter) was needed urgently, the tool was gripped, axially, in a collet, in the Tailstock and racked too and fro using the Tailstock Handwheel, with the Tailstock clamped to the bed. Progress was slow, each axial cut was only about 0.010" deep, rotating the chuck holding the workpiece 90 degrees for each cut. It took time, but eventually produced the required square hole 1/2" deep.
So, if you are wary of filing the keyway, that is another possibility. But putting on the cut using the Cross Slide (as already suggested) would be my preferred method.
Howard