Does anyone use the Button command from the book to get an input from a pin(on/off switch)?

Is there another way to do it ?