It doesn't read his thoughts. He uses a small switch to scan through the letters on the EZKeys keyboard and makes a tiny muscles movement when her gets to the letter or word he wants.
The name of the current program that Stephen hawking uses to communicate on his customized computer, donated by Intel, is called EZKeys. He also uses an older piece of software called EQUALIZER, made in 1986 by WordPlus
Professor Hawking received a new computer donated by Intel corporation in November 2011. The new computer is a Lenovo X220 Tablet PC, housed in a custom chassis in order to mount upon his wheelchair. System specs are as follows: Intel Core i7 CPU, Intel 160GB SSD, 8GB RAM, 12" Daylight Readable Display, HD Webcam (for Skype phone calls), and Windows 7 64-bit.
The basic idea is that back in the 80s he had just enough movement ability in his hands due to his disorder called amyotrophic lateral sclerosis. He would use slight movements of his hands to move cursor on a screen which helps him build sentences. And you know how when you are typing a search into google and it often assumes what you are going to type? Well, his computer does something similar but more advanced in forming sentences so that he did not have to make more slight movements with his hand than he had to. He used to use a machine called the DecTalk DTC01 voice synthesizer. He has since upgraded to the more advanced NeoSpeech VoiceText speech synthesizer, and also unfortunately has since lost any ability to make slight movements with his hand. So the previous answer is correct in that he is only now able to move his cheek on one side of his face. His new speech synthesizer allows him to select words and form sentences on his computer screen, but he controls this one by moving his cheek and a sensored attached to his glasses detects these movements. It often takes him several minutes to form a short response when speaking to someone. For those of us who prefer to just watch a video to have something explained to us, rather than reading my paragraph above, I found a site that provides a number of videos that explain Stephen Hawking's computer speech synthesizer, and above each video it tells you exactly where to fast forward to see the part that focuses on his computer. See the related link.