Running that without a proper license may cause unexpected behavior, contact me to obtain a license.
If you are a licensed user, it will likely render your system inoperable.
What law did I just break?
• short enough, and non-novel enough, not to count as a copyrightable work
• explicitly described as malicious in the accompanying documentation
• not viable for use in a cyberattack (since it can only be run once you've already won)
• doesn't actually work, due to a typo
you probably haven't broken any laws. But, again, I'm not a lawyer; please seek legal advice from an expert in the laws of your jurisdiction if you want an accurate answer.
Keyloggers don't have to be malicious (e.g. you can use it for a global hotkey hook). Thus, writing such software doesn't have to be done with that mindset at all. That being the case, it is ambiguous whether or not those laws apply.
Eh. For something like a keylogger, not really; there are laws against writing and distributing malicious software. In the UK, you can write malware for educational purposes, but woe betide those whose malware escapes or “escapes”: no MIT license disclaimer will save you.