Problem with saving data from Arduino

How is the keypressed() function called when you type something on your keyboard!.

Mark