when you press any button, smilebasic is automatically going to detect it and store it in a variable called BUTTON(). Every key has a certain value that gets added to BUTTON(). For example the A button is 16. When you press A, BUTTON() will be 16. Using the IF command you can check variables for values. In this case "==" means "is equal to".
IF BUTTON()==16 THEN 'run a command
note you have to run it in a constant loop, which skips to it´s beginning everytime it reaches it´s end.
@SOMENAME
IF BUTTON()==16 THEN 'blabla
GOTO@LOOP