Galaxy S keeps accidentally taking screenshot
As suggested here:

Go to the phone application on your phone and enter the following:

*#*#2663#*#*


It will take you to the Touch screen version screen.  Click on the "Touch key FW update" button on that screen.