Hi and Welcome to the Community
You are sure you have checked the settings in midi device area where your midi keyboard needs to be checked in the box? and that you have the record enabled button on the track you are trying to get sound from!?
Best Regards
Christopher