Screen Context
The Screen Context represents a snapshot of the screen at the moment an event occurred.
Purpose and Usage
Screen Context provides all relevant information needed to understand what was exactly visible on the device when the event was triggered. It is included in every screen-related event as well as in some non-screen specific events that could be interpreted differently based on the shown screen in a moment event was triggered (e.g. barcode scan or double trigger event).
Available contextual information:
- Identify which screen (by matching - screenId) and which exact screen view/page (by matching- activeScreenViewId) were shown when the event occurred.
- Access additional contextual information about screen components, for relevant screen view types (e.g. WorkflowView). 
- Identify which Action Buttons were assigned and to which physical button. 
Non-Screen Specific Events with Screen Context
While the Screen Context is primarily designed to provide contextual information for screen-related events, it is now also available for certain non-screen specific events. This addition makes these events significantly more useful on display-capable devices, as they can now be associated with the exact screen state at the time the event occurred.
Barcode Scanned Event
The Barcode Scanned event is triggered whenever a new barcode is successfully scanned by the device.
Along with the scanned barcode content and barcode symbology, this event now also includes the Screen Context.
This enables developers to understand what was being shown on the device screen when the barcode was scanned — for example, which workflow step or view was active. This can help in building more intelligent workflows or logging mechanisms that depend on the user’s visual context at the moment of scanning.
Button Pressed Event
The Button Pressed event is emitted when a hardware button on the device is pressed.It provides the following data:
- Physical or button ID of the pressed hardware button. 
- Screen Context describing what was displayed when the press occurred. 
- Gesture (available on some integration paths, e.g. Intent) — describes press type such as single, double, or triple press 
There are two categories of hardware buttons that can generate this event:
Trigger button
The trigger button is the primary hardware button, usually located on the wearable and used to start the scanning process. Since single press activates the scan engine and does not emit a Button Pressed event; only double-press or triple-press actions do. The trigger button’s physical ID is usually 1.
While not directly relates to the screen, the Screen Context helps the integrator to better interpret the trigger button gesture in screen context — for example, performing an actions on double-press of the trigger depending on the currently displayed screen.
Additional hardware buttons
Some devices might include additional hardware buttons. In case of MAI, there are 4 different hardware buttons located around the screen and they can be associated with the Action Buttons representations on the screen, enabling direct physical interaction with screen actions.
Since Action Buttons are positioned relative to the screen, their actual hardware button assignment depends on the screen orientation and hand preference. Because of this dynamic mapping, the Screen Context becomes essential for determining which Action Button (with its referenceId) was triggered by pressing the hardware button (with its physical or button ID). This mapping is stored in the Action Button Context that is part of the Screen Context.
For convenience, ButtonPress.getCorrespondingPgActionButtonReferenceId() function can be used for determining what exact Action Button was meant to be triggered with the pressed hardware button.
For achieving similar convenience on the Intent and Streams API, there is an extra parameter representing reference ID of the Action Button that was assigned to the pressed physical/hardware button in a moment event was triggered.
In case of the Intent integration, this is returned as a value of the Intent extra with the key: com.proglove.api.extra.DISPLAY_BUTTON_REF_ID.
If there was no Action Button assigned to the physical button, this is an empty String.
Note
Note: On the MAI device, the physical ID does not necessarily match the numbering printed on the device housing next to the buttons.