How to trap a user keypress

Yo,
I program Unix for fun- except when editing my website removed by reborg - and wanted to learn how to track, trap, and use to my advantage a user keypress. I know there is a built-in JS function that can do that, but Javascript is a client-side language, therefore not usable in Unix, and throughout my search, I have not been able to find any built in php funtion to do this- IE looking up functions on php.net/FUNTIONNAME- which is the language that I am using. How would I write this function in php?

Tanks,
SB

So you want something like a keylogger through javascript? The current implementations of javascript in web browsers won't allow you by default to trap user keypresses I guess.

It's not clear what you are looking for.

In what situtation do you want to trap a keypress?

If it's on a web page, then it has to be done client-side -- in the user's browser. That is best done with JavaScript.