Hi Marcelo,
I had this happen many times exactly as you describe.
If you are running a multi-core processor,
try this and see how it works.
When running SONAR: In the Task Manager click the Details tab.
Locate SONAR, it may say SONARPDR.exe.
Right click, choose Select affinity, untick CPU 0
This frees up the main core for Windows as
I believe the other cores are for multitasking.
In a dual processor mobo repeat the same for the other processor.
Sometimes the SONAR glitch will timeout allowing SONAR to restart.
It also helps to restart the computer after a while of work.
When SONAR is running correctly,
the keyboard should work okay with the box ticked in
Edit-Preferences-Midi-Devices and then Midi Track Input.
Of course the SONAR glitch will stop the audio and midi.
You can also try this;
When running SONAR: In the Task Manager click the Details tab.
Locate SONAR, Right click, choose Select Set priority, select
Below normal or Low. This frees up some of the CPU demand.
SONAR meter may indicate ok but Windows and the computer
will still benefit. Any method that frees up resources is good.
If you are running 64 bit SONAR, another thing you can try is
placing the 32 bit VST folders containing their 32 bit dll into the
x64 Windows Cakewalk VST plugins folder. Windows and SONAR
will use them at that location just fine. Simply Scan VST plugins and voila!
In SONAR an x86 Cakewalk folder is only necessary to run SONAR in 32 bit.
Hope all this helps. I also have a working solution for the Bitbridge issue.
Good Luck.
David