Just to get it out of the way:
The keylogger is not for malicious use, it is for security use.
What is it intended for?
To store the user’s keypresses and look for patterns that might resamble keybinds for exploits. I intend it to serve as extra evidence for proving if someone is, or not, an exploiter.
How it should work:
A string of the keypressed recorded would be bitmasked and then stored. Something looking like this:
'WWSSDDDSSAAASSWWDSDD'
Of course it is not just W
, S
, D
and A
keys. And probably those keys shouldn’t be stored as it would make the data full of just movement key presses.
Keypresses during chat also wouldn’t be recorded
Then any common pattern would be detected by a server script, if possitive, then the save is flagged, if negative, the save is cleared.