Extremely tricky because there are so many apps that could be dipping into the event chain.
If you want a nice, months-long, project consider how an average (not a professional) writer should set up their Mac to avoid embarrassment and encourage writing clear, engaging stuff given the huge number of purported writing aids.
Sorry to do it to you. . . . ![]()
Dave