Basic Questions about midi keyboards

Having trouble with LMMS? Ask about it here.
Hi,

In lmms the user can use the pc keyboard to input notes, it is only necessary to select the instrument and play.

I wanted to ask if a midi keyboard works in a similar manner. Once the midi keyboard has been connected the only thing you have to do is select your instruments and input notes, right?

Or do you have to assign the midi keyboard to each of the instruments?
Well, thank you, but If I have more tracks on a project and I assign the midi keyboard to 4 tracks for example, when I play my midi keyboard would all the 4 tracks play at the same time? I ask this because I saw another video in which this was the case.
Maybe you can assign more tracks at once, but I never do this.

I select one instrument, the one were I want to record the midi and then record.

Then move to another track, and un-select the midi devise on the instrument I used first.