Why no actions when the pressed note is from one of the MidiInput?

https://docs.juce.com/master/tutorial_handling_midi_events.html#tutorial_handling_midi_events_keyboard_state:~:text=functions,-.

void handleNoteOn (juce::MidiKeyboardState*, int midiChannel, int midiNoteNumber, float velocity) override
//Called when one of the MidiKeyboardState's keys is pressed.
    {
        if (! isAddingFromMidiInput)
        {
            auto m = juce::MidiMessage::noteOn (midiChannel, midiNoteNumber, velocity);
            m.setTimeStamp (juce::Time::getMillisecondCounterHiRes() * 0.001);
            postMessageToList (m, "On-Screen Keyboard");
        }
    }