The Focused Module Keyboard, at the top-right of the project window, always plays the focused module.
Normally that's the focused track's target, which typically is a rack.
However when previewing sounds, the focus can be switched to the previewed sound.
The Focused Module Keyboard also functions as a virtual keyboard and you can record what you play on it.
It also highlights the notes played via MIDI input.
When needed you can also drag-drop modules on the Focused Module Keyboard to change MIDI focus specifically to that module.
Why would you need to do that?
Well imagine you have a sequence track that plays a sampler rack. In the second slot, after the sampler, you have plugged in a ring modulator that modulates the output of the sampler.
When that track is focused, that target rack is focused too and so the MIDI input notes go to the sampler.
Now when you drag-drop the ring modulator onto the focused module panel, MIDI input focus is set to that ring modulator and so while the sequence is playing the sampler the notes you play on the Focused Module Keyboard or via MIDI will play the ring modulator effect in real time!
To hide the keyboard, right-click it -> Hide This Keyboard.
To re-show the keyboard, right-click the empty space there -> Show Keyboard.
Or goto Preferences -> Show Focused Module Keyboard.