how to log keystrokes in c