That is handled by the control segment, the actual code reacting to events. For example if you enter an item, the event is processed by the control segment. It also defines the general behavior of the mode, while the actual behavior is handled by background tasks.
The control segment is the same for all payload SPEC displays.
EDIT: The item code in the real one would look like that when translated to C++:
Code:
if(KEY==ITEM_ENTER) {
switch(ITEM_NO) {
case 1:
velocity.x = ITEM_S; //double precision float parsed from the input
break;
case 2:
mode = ITEM_I; //Integer parser from decimal input
break;
case 3:
flags = ITEM_O; //integer parser from octal input
break;
}
}