Usual "checklist":
a) does your project routed correctly? If you put some MIDI clip on the track and press "Play", does rapture produce sound? If no, that is routing problem, not keyboard.
b) is "Echo" enabled for the track?
c) is corresponding port enabled in Sonar MIDI preferences? "Mackie Control" use different ports from keys, that is how it can continue to work.
d) can you select corresponding MIDI input instead of "Omni" in the instrument track?
e) does it start to work when you remove surface plug-in from the list?