Defining Key Mappings

Configuration files
  • ..\parameter\client\hal.properties
  • ..\parameter\client\keyboardProcessor.properties

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
The modifier has the following meaning:
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

For oneX, it is possible access the modifier and keycode information by enabling the developer tools in the file ui.properties for the main flow:
UiConfig.screenDisplayConfigs.0.purpose=MainFlow
...
UiConfig.screenDisplayConfigs.0.showDeveloperTools=true

With 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

For OPOS, it is possible to access the modifier and keycode information from the log file. Therefore, the following settings in the file hal.properties are required:
KeyboardDevConfigs.DefaultKeyboard.keyboardTranslationDebugLogLevel=LogAndFireEvent
In addition, configure the log level in the file logging.properties :
log.level.com.gk_software.pos.hal=DEBUG
With these settings, when a key is operated, entries will be written in the following way to the debug log file:
Keyboard event data : 0x2000049, out modif : 2, out char code : 73

Result

For both methods, the result will be the same:
modifier=2
keycode=73

This 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.