Fix Keylogger Code to support better key handling

Code Cleaned up