Logging all the keys a user types? Could you be more specific.
Suppose you had a form and you wanted to maintain a serious logging of every keystroke this could be possible with the use of AJAX I believe. You could essentially redirect any key press event to a php script which logs the strokes somewhere but this seems like a little much.
What is the problem you are trying to solve?
Also, there is more than likely a solution out there for you if you just want to log ips and visitors data etc.