Custom Keyboard Codes

As of v4.1.61 we can create Custom Keyboards to use with [?prompt] notation, and a Custom Keyboard Widget is available for Entity Screens.

For [?prompt] notation, the syntax is:

[?<prompt>;<mask>;<default value>;<flags>;<keycodes>]
  • <prompt> is the question or prompt to display
  • <mask> is a regular expression to define what type of characters (and how many) are allowed
  • <default value> allows for a common value to be pre-entered
  • <flags> lets you define the keyboard type and which buttons appear on it
  • O displays OK button
  • C displays Cancel button
  • N displays Numeric keyboard
  • S displays Alphanumeric keyboard
  • <keycodes> allows for specifying available characters or keys


[?Enter Customer Birthday;([1-9]|10|11|12) (0?[1-9]|[12]\d|30|31) \d{2}\d{2}?;{TICKET TAG:Customer Birthday};ON;49,50,51|52,53,54|55,56,57|8,48,13]

This example breaks down like this:

  • prompt: Enter Customer Birthday
  • mask: ([1-9]|10|11|12) (0?[1-9]|[12]\d|30|31) \d{2}\d{2}?
  • default value: {TICKET TAG:Customer Birthday}
  • flags: ON
  • keycodes: 49,50,51|52,53,54|55,56,57|8,48,13

On a Custom Entity Screen:

  • right-click to select Design Mode
  • right-click again to select Add Widget > Custom Keyboard
  • right-click on the Keyboard Widget to select Settings

Define your own keyboard layout using keycodes:

To create a Custom Keyboard in SambaPOS, specify the keys you want to appear using the Decimal Code (DEC) and use | (pipe) to seperate rows.

By default (no specification), the setting for a keyboard is:


The above produces a Keyboard which looks like this:

Example 1:


The above produces a Keyboard which looks like this:

Example 2:


The above produces a Keyboard which looks like this:

You can find references all over the internet for Key-Codes, but here is a quick reference for some of the more common/useful codes that would pertain to SambaPOS Custom Keyboard.

SYM    DEC    Desc

,    44    Comma  (or use 188)
.    46    Period, dot or full stop  (or use 190)
0    48    Zero
1    49    One
2    50    Two
3    51    Three
4    52    Four
5    53    Five
6    54    Six
7    55    Seven
8    56    Eight
9    57    Nine
:    58    Colon
;    59    Semicolon
*    42    Asterisk
/    47    Slash or divide  (or use 191)
+    43    Plus
-    45    Hyphen
#    35    Number
$    36    Dollar
%    37    Percent
@    64    At symbol
ESC    27    Escape
      127    Delete
BS    8    Back Space
HT    9    Horizontal Tab
LF    10    Line Feed
VT    11    Vertical Tab
FF    12    Form Feed
CR    13    Carriage Return
    32    Space
A    65    Uppercase A
B    66    Uppercase B
C    67    Uppercase C
D    68    Uppercase D
E    69    Uppercase E
F    70    Uppercase F
G    71    Uppercase G
H    72    Uppercase H
I    73    Uppercase I
J    74    Uppercase J
K    75    Uppercase K
L    76    Uppercase L
M    77    Uppercase M
N    78    Uppercase N
O    79    Uppercase O
P    80    Uppercase P
Q    81    Uppercase Q
R    82    Uppercase R
S    83    Uppercase S
T    84    Uppercase T
U    85    Uppercase U
V    86    Uppercase V
W    87    Uppercase W
X    88    Uppercase X
Y    89    Uppercase Y
Z    90    Uppercase Z
a    97    Lowercase a
b    98    Lowercase b
c    99    Lowercase c
d    100    Lowercase d
e    101    Lowercase e
f    102    Lowercase f
g    103    Lowercase g
h    104    Lowercase h
i    105    Lowercase i
j    106    Lowercase j
k    107    Lowercase k
l    108    Lowercase l
m    109    Lowercase m
n    110    Lowercase n
o    111    Lowercase o
p    112    Lowercase p
q    113    Lowercase q
r    114    Lowercase r
s    115    Lowercase s
t    116    Lowercase t
u    117    Lowercase u
v    118    Lowercase v
w    119    Lowercase w
x    120    Lowercase x
y    121    Lowercase y
z    122    Lowercase z

@emre, I tried to create a completely vertical keypad using:


But it appears with 2 buttons per row, instead of only 1, and then the last 2 rows are inexplicable…

1 Like

There are a few more codes I found through trial and error. Here is my full keyboard I made.


Notice 188,190,191 are Comma,Period,Forward Slash.

1 Like

If a row does not contain a , it tries to parse letters one by one.This is a feature to create letter buttons easily. For example


Now you tell us after I painstakingly created my keyboard.

1 Like

Ok, thanks for that… useful feature. Can you give me a work-around or trick for this?

EDIT: @emre, I found a Trick, but this will only work with the Custom Keyboard Widget on an Entity Screen, and not with a [?Prompt]good enough for my purpose: