
Chapter 17: Trigger Control
Overview
179
Psion Mobile Devices Developers Guide
17.1 Overview
All Psion computers have one or more keyboard [SCAN] buttons, some have [SCAN] buttons on the side,
and some have the option for a pistol grip trigger. Usually, these buttons are all used to initiate a bar code
scan or an RFID read cycle. The Mobile Devices SDK allows you to select any keyboard key or the pistol grip
trigger as the means of controlling hardware activity. Ownership of the trigger mechanisms can be defined
in the Mobile Devices SDK.
Each time a trigger is pressed or released an event is generated. The Mobile Devices SDK also enables an
application to generate simulated trigger events.
17.2 Definition Of Terms
Trigger source: A trigger source causes a trigger event. A trigger source is one of the following:
• The pistol grip trigger.
• Any key on the keyboard of the Psion computer, including any [SCAN] buttons.
Trigger source ID: Each trigger source has a unique trigger source ID in the form of an integer.
Friendly name: Each trigger source can have a user-friendly name. The friendly name appears on the GUI
Manage Triggers applet, and only trigger sources with a friendly name defined can be accessed through
the applet. This name—maximum 15 characters— is the name of the keyboard key or the trigger source, for
example:
•Grip Trigger
•F1
•Scan
• L. Side Scan
If your application creates a new trigger source, and you want to access the trigger source through the
Manage Triggers applet, you must give it a friendly name.
Trigger consumer: An application that receives trigger events. Each trigger consumer is identified by its
unique name—a character string.
Trigger association: A mapping between a trigger source and a trigger consumer.
Double-click time: This is the maximum length of time allowed between two successive presses of a trigger
source for a double-click event to be generated. The default value is 0 (zero).
17.3 Trigger Consumer Registration
Each application that is a trigger consumer must be registered to receive the trigger events. During regis-
tration, a unique trigger consumer name must be associated with the trigger consumer. Once it is regis-
tered, it can be associated with one or more trigger sources. Deregistering a trigger consumer makes all its
trigger associations inactive—they become active again when the consumer registers again.
17.4 Trigger Source IDs
A trigger source ID is associated with the pistol grip trigger or one of the keyboard keys using keyboard
remapping. See Section 7.2 Keyboard Remapping on page 51 for information on how to do this.
Trigger source IDs are unique. The first 256 ID numbers (0-255) are reserved as system (non-keyboard)
trigger IDs. Most system trigger IDs will not be available to applications (e.g. most external scanner trig-
gers). The most notable exception is the pistol-grip trigger, which has the system trigger ID value of
0(zero).
Keyboard trigger sources start at 256—0x100. The trigger source ID for a specific key is 256 plus the virtual
key code. See Section 7.2 Keyboard Remapping on page 51 for information on virtual key codes. For
example the virtual key code for the [F1] key is 40. So the trigger source ID for the [F1] key is 296; the sum
of 256 and 40.
Comentarios a estos manuales