Using Applescript to fool key logger with keystrokes
Well, it might kind of work, but idk if it would do what you want to achieve.

This script 

tell application "TextEdit"
    activate
    make new document
    delay 1
    repeat 100 times
        tell application "System Events"
            keystroke "the quick brown fox jumps over the lazy dog"
            keystroke return
        end tell
    end repeat
end tell


will start typing into whichever document is frontmost when it starts after the 1s delay time for TextEdit to come to the front.
Once it's typing, you can switch to another app &amp; continue what you were doing - but you can't use TextEdit as it won't let any other document come to the front until it's finished.

If you switch to another app before it starts typing, it will type into that instead.

Whether that would fool a key logger, I have no clue - but that begs the question…
what makes you think you have a key logger &amp; why not get rid of it instead?  

If it's some kind of 'corporate' checkup on employees, consider how long it might take before they noticed it &amp; wondered why you felt it necessary to try to bypass - something presumably covered in a contract of employment.