The callback reason, returned in the $reason variable, specifies why the action occurred.
The variable’s value is set for any kind of action, but you need to inspect it only when the action is associated with an edit_box, list_box, image_button, or slider tile. The following outlines the values of each callback reason code:
This is the value for most action tiles. The user has selected the tile (possibly by pressing Enter, if the tile is the default and the platform recognizes accelerator keys).
The user has exited the edit box—by pressing the Tab key or by choosing a different tile—but has not made a final selection. If this is the reason for an edit box callback, your application should not update the value of the associated variable, but should check the validity of the value in the edit box.
The user has changed the value of the slider by dragging the indicator (or an equivalent action), but has not made a final selection. If this is the reason for a slider callback, your application should not update the value of the associated variable but should update the text that displays the slider's status.
This callback reason always follows a code 1. It usually means “commit to the previous selection.” It should never undo the previous selection; this confuses and annoys the user.
List boxes that allow the user to select multiple items (multiple_select = true) cannot support double-clicking.