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
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,
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.
|NNN||Digits. 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
|+Ccc||Actual 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||
|#NNN||Hot 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||
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
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
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
- 9 Tab
- 13 Enter
- 27 Escape
- 32 Space Bar
- 45 Insert
- 44 Printscreen
- 48 0 (main keyboard)
- 49 1 (main keyboard)
- 50 2 (main keyboard)
- 51 3 (main keyboard)
- 52 4 (main keyboard)
- 53 5 (main keyboard)
- 54 6 (main keyboard)
- 55 7 (main keyboard)
- 56 8 (main keyboard)
- 57 9 (main keyboard)
- 106 Multiply (numeric keypad)
- 107 Add (numeric keypad)
- 96 0 (numeric keypad)
- 97 1 (numeric keypad)
- 98 2 (numeric keypad)
- 99 3 (numeric keypad)
- 100 4 (numeric keypad)
- 101 5 (numeric keypad)
- 102 6 (numeric keypad)
- 103 7 (numeric keypad)
- 104 8 (numeric keypad)
- 105 9 (numeric keypad)
- 112 F1
- 113 F2
- 114 F3
- 65 A
- 66 B
- 67 C