Complex input checking.

BlitzMax Forums/BlitzMax Beginners Area/Complex input checking.

I'm working on a game that uses only 2 buttons. This is for a competition so I'm very restricted.

I need to code the following.

if buttons a and b are both released
preform action x

else ' the following actions will not be done if both buttons are pressed
     
     if button a is down and button b is up
           preform action a
     endif

     If button b is down and button a is up
           preform action b
     endif
endif


So if both buttons are down action x is done and the single button down test are never done. However if only one button is down then choose the right action for the button that is pressed. I need a way to check for buttons being released rather than buttons down and if buttons a and b are released then the single button pressed checks should not be executed.