Well, I believe that the JoyStick class has a "JoyStickButton"(or something similar) function.
There is a WPIlib documentation file which is very useful, it came with your WPIlib download.
Here is something that should make the robot drive forward for 1 second when "1" is pressed on the controller.
Code:
if(JoyStick1.RawButtonValue(1)
Drive(.5,1);
else
Drive(0.0,0.0);
Try putting that in the OperatorControl function
By the way, you would need to edit "JoyStick1" to the name of your mainstick.
If you are using SimpleTemplate and have not changed anything, it should be "stick"