Hi EtherealEntity,
In situations like this, tech support would have you try a couple of things:
1. In C:\Users\<your current user>\AppData\Roaming\Cakewalk\SONAR X2 Producer delete the following files:
Cakewalk.ini
TTSSEQ.INI
This will reset your MIDI devices settings in Sonar so you would need to re-select them in Preferences - MIDI devices.
2. If that fails, try re-personalization. Start Sonar with the CTRL + SHIFT keys pressed, this will re-copy necessary files and reset some registry keys in case they became corrupted.
Doing these two things should reset everything back to factory default so any settings preventing MIDI input would get wiped and reset.
The only other thing that we do differently that may cause a problem is we send local control off at start of Sonar by default. This could be causing an odd setting to happen on your keyboard controller. To see if that's the case, disconnect your MIDI keyboard controller, start up Sonar, and re-connect it. If you can record from this point, the local control off setting is screwing with the controller. There's an ini flag you can set to turn that off.
Hope this helps.