Hi matteo, Right click on the "Arm" button and check out "Record: MIDI overdub/replace", there are 4 selections there.
The way I like to record midi in Reaper is to first add a full length midi item to the track going from the beginning
to just beyond the end of the song/project. Then I use "Record: MIDI overdub/replace>Record: MIDI overdub" and record
directly in the midi editor.
That gives me track based midi which Reaper doesn't have.