You can use a program such as Trusteer Raport. The best defense isn’t to detect a keylogger. Its to prevent one. Using a password manager is one step. A virtual keyboard is another. You can also use Zemana AntiLogger. Most antiviruses detect keyloggers when its already too late. I have been using Lastpass for years. I never type in anything into my browsers as far as logins or passwords. Using a good browser such as Google Chrome is another step. But again nothing is perfect or foolproof.