Button management
This shows how you can use the ASCII keyboard of your computer to detect which key has been pressed and how long for. You can use it as a starting point for managing the button input on your project. Download the patch here:

For a slightly more advanced set of button-based features, you could look at this. It gives you the ability to detect a range of features, including how manu counts of the button have happened.
