The problem is that there is the need to have a MIDI port with a device available, otherwise Cubase won’t be able to record the notes. Using a VSTi keyboard in its window doesn’t allows this, unless you are lucky enough to have one of the rare VSTis that can transmit MIDI output, in order to be available as a MIDI port in the ‘Input routing’ selector of the track inspector. As an example, BFD2 can do so, but there are not many of them.
A workaround is to use Cubase virtual keyboard ( on the transport bar and select it in the popup menu) : it is limited in the way that there is only a fixed velocity available while playing, adjustable with a cursor. But, at least, there is a piano like option that allows you to play directly on 3 octaves and yes, you can record notes, even with glissando this way. There are also pitch bend and modulation adjustments available.
But to be able to record with it, you have to select ‘All MIDI inputs’ in the ‘Input routing’ selector of the track inspector. Using any other port will not allow you to record what you play with it.