PushButton

PushButtonSelect

Activate a focused push button

Syntax

Signature
xBool           PushButtonSelect( PushButton *pushButton, int key );

Arguments

pushButton the push button.

key the input event that triggered activation. Use NIL to activate immediately without waiting for input.

Return value

T on success, or F if the object is NULL.

Description

With focus, the function sets the buffer to `T` and draws the pressed button. After any wait, it calls the action callback if set, clears the buffer and redraws the button. The callback sees the pressed state. An unfocused button returns `T` without activating.

For `K_SPACE`, the function consumes repeated Space events until a short pause or another key. For `K_LBUTTONDOWN` or `K_LDBLCLK`, it waits while the left button is down, until release or a non-mouse event. An intervening key is put back in the input buffer. Other key codes activate immediately.

See also