The Focused Module Keyboard, at the top-right of the project window, always plays the focused rack/module.
Normally that's the focused track's target, which typically is a rack.
However when previewing sounds, the focus switch 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!
Another way to quickly switch MIDI focus to a specific module is using a shortcut to the "Play From MIDI Input" function.
Click on module name field (so it has GUI focus) then press that shortcut key.
That will temporarily set MIDI focus to that module.
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.
Virtual MIDI Keyboard
Via right-click on the Focused Module Keyboard you can popup the Virtual MIDI Keyboard.
With the Virtual MIDI Keyboard you can use the computer keyboard to play and record notes.
The Page Up/Page Down keys change the Octave Shift.