CODE
set_mode(320,240,16);
This sets the screen surface to be 320*240 and 16bpp
CODE
if(key(_alt))
Do Some Stuff
End
_alt is the B button on the GP2x. There is a full list of the buttons and their symbolic constants in the Readme files supplied with the GP2x fenix runtimes.