A keystroke logger is one of the malware apps that logs every keystroke you enter; obviously it's most useful for delimited strings, such as passwords.
There are many versions of the malware; some are easily available and often used for parental surveillance — which doesn't make it "legitimate".
There's a fair bit of info online; just Google it.

You have to find it (if indeed it's lurking on your machine) in order to remove it.