Check this thread:
http://www.pocketmatrix.com/forums/view ... hp?t=22413
In PocketFrog, it's basically the same thing. When ButtonDown() or ButtonUp() is called, change the state variable, and check the variable during GameLoop(). If you want to use just one variable for all the button data, you can assign each button a value like 1,2,4,8,16,32,64,128 and add/subtract that amount for button presses/releases, but I generally like to use booleans for it.