It's messy, and involves some cheap adapters but:
Keyboard - KVM:
USB keyboard ----- USB to PS/2 convertor (like
this) ----- KVM switch IN
KVM - Mac:
KVM switch OUT1 ----- PS/2 Male-Male cable ----- PS/2 to USB convertor (like
this) ----- MAC USB port
KVM - Peg:
KVM Switch OUT2 ----- PS/2 Male-Male cable ----- Peg PS/2 port
Assuming the USB keyboard can also function as a PS/2 device this should do the trick I think ;-)