Provides access to button states of connected Grabba devices.
This API provides access to the driver's button functionality, which is present on all Grabba devices.
Current hardware models have two buttons - one on the left side of the device, the other on the right. This API may be expanded if future models have additional buttons.
Callbacks to user-provided code may be triggered when the user presses or releases a button on a connected device. Refer to the ButtonListener class for details of these callbacks and how to enable or disable them.
In addition, each button may be configured to control barcode or proxcard scanning. The default behaviour is to only trigger callbacks, but the setLeftButtonBehaviour() and setRightButtonBehaviour() functions allow for enabling or disabling press-to-scan functionality.
Calls to this class will not succeed until a connection to a Grabba device has been established. Refer to the CoreAPI class for details of how to establish or query this connection.
Thread safety: This class is fully thread-safe.
Classes | |
enum | ButtonBehaviour |
Enumeration of supported button behaviours. More... | |
Static Public Member Functions | |
static ButtonBehaviour | leftButtonBehaviour () |
Query the current behaviour of the left button. More... | |
static boolean | leftButtonState () |
Query the left button state of a connected Grabba device. More... | |
static ButtonBehaviour | rightButtonBehaviour () |
Query the current behaviour of the right button. More... | |
static boolean | rightButtonState () |
Query the right button state of a connected Grabba device. More... | |
static void | setLeftButtonBehaviour (ButtonBehaviour behaviour) |
Set new behaviour for the left button. More... | |
static void | setRightButtonBehaviour (ButtonBehaviour behaviour) |
Set new behaviour for the right button. More... | |
|
static |
Query the current behaviour of the left button.
|
static |
Query the left button state of a connected Grabba device.
This is a non-blocking call; the button states are cached internally by the driver.
|
static |
Query the current behaviour of the right button.
|
static |
Query the right button state of a connected Grabba device.
This is a non-blocking call; the button states are cached internally by the driver.
|
static |
Set new behaviour for the left button.
behaviour | New behaviour for the left button. ButtonBehaviour.CALLBACK_ONLY is the initial value. |
|
static |
Set new behaviour for the right button.
behaviour | New behaviour for the right button. ButtonBehaviour.CALLBACK_ONLY is the initial value. |