Fieldpine Logo Documentation Home  
User Interface Home

These directives register single keystrokes and keystroke sequences as performing commands directly. This allows the user to press the keyboard and run the POS.

If you are defining buttons to perform an action, you should use the keys() option on the button rather than this directive. This makes the button register the keystrokes directly which has the advantage that any changes to the button action (ie what it does) do not need to be changed on the keys() directive also

You should use the keys() and keystr() directives to define keystrokes that are not necessarily visible to the user

Command Options

Single Keys

The key directive has a different structure to many commands, the only option that is possible is to define the key(s) in question.

To define a key, enter the virtual key code for the key as a decimal number. eg,

6020|main|||key|45| ...

The numeric virtual key codes are taken from the Microsoft Windows table of keys, even for browsers, Android and iOS environments. Not all keys can be defined or altered. The escape key and tab keys are reserved for Windows operation.

Alternatively, you can start with "+" and then enter a list of actual keys. eg "+Aa" defines both capital and lowercase A.

NNNDigits. Define the key using its internal keycode value. List
If you wish to capture "ctrl-NNN" enter the value of the key and add 3072 to the value.
|65| - "A" key
|3137| - "Ctrl-A" key
+CccActual characters. Sets that "Ccc" are individual key names. Ccc can be a list of 1 or more keystrokes |+A|
%...Reserved. Cannot be used.
The keywords "any" or "all" can be used to register and capture every keystroke. This is often used on a sub menu screen where any key can be pressed to dismiss the screen. |any|
#NNNHot Key Digits. Defines the key as a hot key, which makes it available system wide regardless of which application is currently foreground. Not widely used but can be utilised to trigger a POS Command even when not foreground. |#1069|

Key Sequences

In addition, you can define a sequence of keys to perform an operation. The user must enter all the characters to perform an action. Keys are not echo as entered.

To enter a key sequence, simply enter the characters that must be typed. eg

6020|payend|||keystr|k9|pastsales(print-1) screen(1delete)|4071

Typically sites will use a single shortcut key, often the slash character ( / ), to begin sequences.

Fieldpine reserves key sequences beginning with the percent sign ( % ) for support shortcuts and operations

Examples of Use

Define that key number 45 (the "insert" key) should send a specialised command to other screen elements to process a manually entered weighed item

6020|main|||key|45|sale? sendstr(sendweighprd,kp)|7

Define that the keys "1" and "2" will add discounts to the current saleline. Normally you would not override the keys for digits (as it stops you entering numbers), but in this case they are being used on a subscreen ("discounts") as shortcut keys

6020|discounts|||key|+1|sale(line,cleardiscount) discount(percent,-1,5) screen(1delete)|4003
6020|discounts|||key|+2|sale(line,cleardiscount) discount(percent,-1,10) screen(1delete)|4003

Virtual Key List