Defining Key Mappings
| Configuration files |
|
The keyboard is enabled in the file hal.properties .
The configuration is defined mainly in the file keyboardProcessor.properties .
To define a key, two entries have to be configured:
Function configuration
At least, the following values are required:
| Parameter | Description |
|---|---|
| processName | Process during which the function can be called, e.g. Payment or ItemRegistration |
| reactionName | Function to be called Enter the value reactionName according to reactionType: If reactionType corresponds to a transition, the desired transition must be entered here. |
| reactionType | Type of function called (e.g. response or transition) |
| id | ID |
The example below shows the configuration for terminal payment.
ProcessReactionKeyboardActions.StartPaymentTerminalProcess.processReactions.0.processName=Payment
ProcessReactionKeyboardActions.StartPaymentTerminalProcess.processReactions.0.reactionName=terminalPayment
ProcessReactionKeyboardActions.StartPaymentTerminalProcess.processReactions.0.reactionType=Transition
ProcessReactionKeyboardActions.StartPaymentTerminalProcess.id=32
The Terminal Payment function is called by using the transition terminalPayment, in the payment mask only.
If you define the value reactionName only, the default configuration will be called. In addition, you can define some function parameters or a configId.
If you define a parameter, the configId must be indicated as well.
ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial.processReactions.0.processName=ItemRegistration
ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial.processReactions.0.reactionName=merchandiseCategorySale
ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial.processReactions.0.reactionType=Transition
ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial.configId=MerchandiseCategorySaleConfigs.Default
ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial.configParameters.0.name=inputMerchandiseGroupId
ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial.configParameters.0.value=030300
ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial.id=19
In our example, the merchandise category 030300 is stored in a key, by means of the parameter inputMerchandiseGroupId. For this purpose, the configId MerchandiseCategorySaleConfigs.Default is loaded.
The configId can be defined in the configuration file of the corresponding function. In our example, it is stored in the file merchandiseCategorySaleConfigs.properties .
Key Configuration
In the second entry, you have to define the key to be used for the function call.
The following values are required:
| Parameter | Description |
|---|---|
| id | ID |
| name | User-defined entry name |
| keyEventType | Defines the method of key
operation: KEY_TYPED=400 KEY_PRESSED=401 KEY_RELEASED=402 |
| modifier | See explanation below. |
| keycode | See explanation below. |
| processReactionKeyboardActions | References the function to be called by operating the key. |
There are two options for defining the modifier and keycode.
Defining modifier and keycode based on manufacturer information
For each keyboard key, there is some information similar to:
0x760041=0x2000049
Relevant information is the part after =. The last two digits represent the keycode in hexadecimal. The hexadecimal number 49 e.g. corresponds to the decimal number 73.
The first three digits correspond to the modifier (in our example, 0x2; therefore, modifier=2). The following applies:
| Entry | Explanation |
|---|---|
| 0x0 | modifier=0 |
| 0x1 | modifier=1 |
| 0x2 | modifier=2 |
| 0x3 | modifier=3 |
| 0x4 | modifier=8 |
| 0x5 | modifier=9 |
| 0x6 | modifier=10 |
| 0x7 | modifier=11 |
| Modifier | Description |
|---|---|
| 0 | For "single" entry (just enter one key) |
| 1 | For combined entry with Shift |
| 2 | For combined entry with Strg |
| 3 | For combined entry with modifier 1 and modifier 2, means Shift + Strg |
| 4 | Meta Key (e.g. Windows Key) |
| 8 | For combined entry with Alt |
| 9 | For combined entry with modifier 1 and modifier 8, means Shift + Alt |
Defining modifier and keycode
OneX
UiConfig.screenDisplayConfigs.0.purpose=MainFlow
...
UiConfig.screenDisplayConfigs.0.showDeveloperTools=trueWith these settings, when a key is operated, entries will be written in the following way to the additional developer tool window:
FLOWSERVICE_CLIENT_MESSAGE_KEYBOARD_INPUT
{
"processEventSource": "KE",
"extendedProcessEventSource": "KE_KEYB_POS",
"keyEventType": 401,
"modifier": 2,
"keyCode": 73,
"descriptorId": 37
}
OPOS
KeyboardDevConfigs.DefaultKeyboard.keyboardTranslationDebugLogLevel=LogAndFireEventlog.level.com.gk_software.pos.hal=DEBUGKeyboard event data : 0x2000049, out modif : 2, out char code : 73Result
modifier=2
keycode=73This information allows you to create a complete entry as shown below (example):
KeyboardProcessorConfig.keyboardInputConfigs.126.id=126
KeyboardProcessorConfig.keyboardInputConfigs.126.name=MerchandiseCategorySaleSpecial
KeyboardProcessorConfig.keyboardInputConfigs.126.keyEventType=401
KeyboardProcessorConfig.keyboardInputConfigs.126.modifier=2
KeyboardProcessorConfig.keyboardInputConfigs.126.keycode=73
KeyboardProcessorConfig.keyboardInputConfigs.126.processReactionKeyboardActions.0=reference\:ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial
Via ProcessReactionKeyboardActions.StartMerchandiseCategorySaleSpecial, this entry references the function Merchandise Category Sale.