Simply put, if you install a keylogger on a device you own, it is legal. If a keylogger is installed behind the back of the actual owner to steal data, it is illegal.
Can a keylogger be detected?
Here's where things get scary: 80% of software keyloggers are not detectable by firewalls or antivirus programs, and their popularity with businesses makes them incredibly easy to find and download. In fact, you can go download a keylogger right this moment.
Can a keylogger listen to your conversations?
A remote keylogger can also turn on the microphone to record conversations. This enables the hacker to listen to your personal conversation that includes video calls and voice chats. A remote keylogger transmits the information to a remote server.