Although the modeling details to be incorporated largely depend on the functioning of your physical system and accuracy required;
to compare with a hand calculation (of peak shear stress in the key for failure), a simple 3D model of just the key, with corresponding loads from the shaft and...