BTRIG is not a function in SmileBasic V1.


BTRIG is a system function that takes no parameters and indicates what buttons have been recently pressed. It functions the same as Button(1), and is just a convenient alias.

The value returned by BTRIG() is recalculated at the beginning of every "frame", that is, every 1/60th of a second (and for the duration of the frame, it does not change). If, during the previous frame, a button had changed from being up to being down, a bit is set in the value of BTRIG(), otherwise (if the button had been down all during the previous frame, or if it had remained up, or if it had changed from being down to being up) the bit is clear.

BTRIG() is usually used in conjunction with VSYNC; e.g., without VSYNC 1 between successive calls to BTRIG(), both calls may occur in the same frame, both indicating that a button has been recently pressed, and the program may behave as if the button had been pressed twice when it had actually only been pressed once.

The bit masks are the same as for BUTTON():

1D-pad up
2D-pad down
4D-pad left
8D-pad right
Since SELECT stops any running program when it is pressed, using SELECT is not useful with BTRIG().


BTRIG has been replaced by BUTTON(2) .

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.