Waits for input from the key or the barcode reader in the menu display and returns an event if there is any input.

Syntax

int AM_ExecMenu(
  MENU_HANDLE menu
);

Parameters

menu
[in] Menu handle

Return value

Returns one of the events in the following table.
ValueDescription
AMENU_CHECK_CHANGED Indicates that the value of a radio button or check box has changed.
AMENU_TEXT_CHANGED Indicates that the value of the input field has changed.
AMENU_FOCUS_CHANGED Indicates that the focus has moved.
AMENU_BARCODE_READ Indicates that the barcode was read.
The read barcode data is stored in the buffer specified by AM_BarcodeBuffer structure.
AMENU_SPECIAL_KEY Indicates that the special key operation specified by the SpecialKey1 and SpecialKey2 members of the AM_Option structure has been detected.
AMENU_BEGIN_CANDIDATE Indicates that display of candidate characters for English mode or HEX mode has started in the input field.
AMENU_UPDATE_CANDIDATE Indicates that display of candidate characters for English mode or HEX mode has been updated in the input field.
AMENU_CALLBACK_BREAK Indicates that the callback function registered by AM_SetIdleCallback function returned false.
NUM0_KEY Indicates that the [0] key has been pressed.
NUM1_KEY Indicates that the [1] key has been pressed.
NUM2_KEY Indicates that the [2] key has been pressed.
NUM3_KEY Indicates that the [3] key has been pressed.
NUM4_KEY Indicates that the [4] key has been pressed.
NUM5_KEY Indicates that the [5] key has been pressed.
NUM6_KEY Indicates that the [6] key has been pressed.
NUM7_KEY Indicates that the [7] key has been pressed.
NUM8_KEY Indicates that the [8] key has been pressed.
NUM9_KEY Indicates that the [9] key has been pressed.
SCAN_KEY Indicates that the [SCAN] key has been pressed.
Q1_KEY Indicates that the [Q1] key has been pressed.
Q2_KEY Indicates that the [Q2] key has been pressed.
BS_KEY Indicates that the [BS] key has been pressed.
CLR_KEY Indicates that the [CLEAR] key has been pressed.
ENT_KEY Indicates that the [ENT] key has been pressed.
SHIFT_KEY Indicates that the [SHIFT] key has been pressed.
DOT_KEY Indicates that the [.] key has been pressed.
F1_KEY Indicates that the [F1] key has been pressed.
F2_KEY Indicates that the [F2] key has been pressed.
F3_KEY Indicates that the [F3] key has been pressed.

Remarks

This function automatically performs the following processing according to the settings.
  • Display the highlight on the menu item that has focus.
  • Moves the focus forward or backward when you press the [Q1] key or the [Q2] key.
  • When the menu item that has a check box has the focus, pressing the [SCAN] key switches the check box on and off.
  • When the menu item with a radio button has focus, pressing the [SCAN] key turns the radio button on.
  • When the input field has the focus, the input editing is performed.
  • When the barcode reader is enabled, pressing the [SCAN] key starts scanning the barcode.
  • Returns an event if there is any input.
  • If there is no input, wait for input while calling Idle function.

Two events may be returned with one key operation. For example, when the focus is moved with the [Q2] key, the AMENU_FOCUS_CHANGED event is returned first, and then the Q2_KEY event is returned.
To clear the second event when the first one is received, call the AM_SetEvent function with setting the event parameter to 0.

Requirements

Header file:
lib.h
AdvancedMenu.h
Library file:
libAdvancedMenu.a
libSTARTUPOPH5000.a

See also

Last updated: 2020/10/16