A9 Character Set, Keyboard

This Appendix deals with the QL character set and keyboard.

A9.1 The Character Set

The codes from 0 to 31 (except 10) and 192 to 254 are not standardised - they are undefined on standard QLs (a checkerboard square) but Minerva sets them to the characters listed below. The keying required for many of the characters seems to differ on every type of machine, which is very annoying for the programmer.

Some of the keyings will also be different on new replacement keyboards, although these normally only add to the standard set.

We have supplied the keyings on standard British and German QLs so that you can see where problems may occur in different keyings. We recommend that you make your program fully configurable if these differences appear to be a problem.

The full character set is:

Code Character Keys to press
0 NUL <CTRL> <£> British <CTRL> < ESC> German
1 F1 <CTRL> <A>
2 F2 <CTRL> <B>
3 F3 <CTRL> <C>
4 F4 <CTRL> <D>
5 F5 <CTRL> <E>
6 AK <CTRL> <F>
7 minim <CTRL> <G>
8 BS <CTRL> <H>
9 HT <CTRL> <I> <TAB>
10 NL <CTRL> <J> <ENTER>
11 VT <CTRL><K>
12 FF <CTRL><L>
13 CR <CTRL><M>
14 SO <CTRL><N>
15 SI <CTRL><O>
16 0 (small 0) <CTRL><P>
17 1 (small 1) <CTRL><Q>
18 2 (small 2) <CTRL><R>
19 3 (small 3) <CTRL><S>
20 4 (small 4) <CTRL><T>
21 5 (small 5) <CTRL><U>
22 6 (small 6) <CTRL><V>
23 7 (small 7) <CTRL><W>
24 8 (small 8) <CTRL><X>
25 9 (small 9) <CTRL><Y>
26 A (small A) <CTRL><Z>
27 B (small B) <ESC>, <CTRL><SHIFT><[> British <CTRL><SHIFT><Ü> German
28 C (small C) <CTRL><SHIFT><\> British <CTRL><SHIFT><<> German
29 D (small D) <CTRL><SHIFT><]> British <CTRL><SHIFT><+> German
30 E (small E) <CTRL><SHIFT><£> British <CTRL><SHIFT><\> German
31 F (small F) <CTRL><SHIFT><ESC>
32 (space) <SPACE>
33 ! (exclamation) <SHIFT><1>
34 ” (speech mark) <SHIFT><’> British <SHIFT><2> German
35 # (hash) <SHIFT><3> British <#> German
36 $ (dollar) <SHIFT><4>
37 % (percent) <SHIFT><5>
38 & (ampersand) <SHIFT><7> British <SHIFT><6> German
39 ‘ (quote) <’> British <SHIFT><#> German
40 ( (bracket) <SHIFT><9> British <SHIFT><8> German
41 ) (bracket) <SHIFT><0> British <SHIFT><9> German
42 * (asterisk) <SHIFT><8> British <SHIFT><+> German
43
  • (plus)
<SHIFT><=> British <+> German
44 , (comma) <,>
45
  • (minus/hyphen)
<->
46 . (fullstop) <.>
47 / (stroke) </> British <SHIFT><7> German
48 0 <0>
49 1 <1>
50 2 <2>
51 3 <3>
52 4 <4>
53 5 <5>
54 6 <6>
55 7 <7>
56 8 <8>
57 9 <9>
58 : (colon) <SHIFT><;> British <SHIFT><.> German
59 ; (semicolon) <;> British <SHIFT><,> German
60 < (less than) <SHIFT><,> British < < >German
61 = (equal) <=> British <SHIFT><=> German
62 > (greater) <SHIFT><.> British <SHIFT>< < >German
63 ? (question mark) <SHIFT></> British <SHIFT><á> German
64 @ (address symbol) <SHIFT><2> British <CTRL><\> German
65 A <SHIFT><A>
66 B <SHIFT><B>
67 C <SHIFT><C>
68 D <SHIFT><D>
69 E <SHIFT><E>
70 F <SHIFT><F>
71 G <SHIFT><G>
72 H <SHIFT><H>
73 I <SHIFT><I>
74 J <SHIFT><J>
75 K <SHIFT><K>
76 L <SHIFT><L>
77 M <SHIFT><M>
78 N <SHIFT><N>
79 O <SHIFT><O>
80 P <SHIFT><P>
81 Q <SHIFT><Q>
82 R <SHIFT><R>
83 S <SHIFT><S>
84 T <SHIFT><T>
85 U <SHIFT><U>
86 V <SHIFT><V>
87 W <SHIFT><W>
88 X <SHIFT><X>
89 Y <SHIFT><Y>
90 Z <SHIFT><Z>
91 [ (square bracket) <[> British <CTRL><9> German
92 \ (backslash) <\>
93 ] (square bracket) <]> British <CTRL><0> German
94 ^ (circumflex) <SHIFT><6> British <SHIFT><\> German
95 _ (underscore) <SHIFT><->
96 £ (pound) <£> British <CTRL><7> German
97 a <A>
98 b <B>
99 c <C>
100 d <D>
101 e <E>
102 f <F>
103 g <G>
104 h <H>
105 i <I>
106 j <J>
107 k <K>
108 l <L>
109 m <M>
110 n <N>
111 o <O>
112 p <P>
113 q <Q>
114 r <R>
115 s <S>
116 t <T>
117 u <U>
118 v <V>
119 w <W>
120 x <X>
121 y <Y>
122 z <Z>
123 { (brace) <SHIFT><[> British <CTRL><á> German
124 | (vertical line) <SHIFT><\> British <CTRL><8> German
125 } (brace) <SHIFT><]> British <CTRL><#> German
126 ~ (tilde) <SHIFT><£> British <CTRL><#> German
127 copyright <SHIFT><ESC>
128 a umlaut <CTRL><ESC> British <Ä> German
129 a tilde <CTRL><SHIFT><1>
130 a circle <CTRL><SHIFT><’> British <CTRL><SHIFT><Ä> German
131 e acute <CTRL><SHIFT><3>
132 o umlaut <CTRL><SHIFT><4> British <Ö> German
133 o tilde <CTRL><SHIFT><5>
134 o bar <CTRL><SHIFT><7>
135 u umlaut <CTRL><’> British <Ü> German
136 c cedilla <CTRL><SHIFT><9>
137 n tilde <CTRL><SHIFT><0>
138 ae diphthong <CTRL><SHIFT><8>
139 oe diphthong <CTRL><SHIFT><=> British <CTRL><SHIFT><#> German
140 a acute <CTRL><,>
141 a grave <CTRL><-> British <CTRL><SHIFT><4> German
142 a circumflex <CTRL><.>
143 e umlaut <CTRL></> British <CTRL><-> German
144 e grave <CTRL><0> British <CTRL><SHIFT><V> German
145 e circumflex <CTRL><1>
146 i umlaut <CTRL><2>
147 i acute <CTRL><3>
148 i grave <CTRL><4>
149 i circumflex <CTRL><5>
150 o acute <CTRL><6>
151 o grave <CTRL><7> British <CTRL><SHIFT><,> German
152 o circumflex <CTRL><8> British <CTRL><SHIFT><D> German
153 u acute <CTRL><9> British <CTRL><Ä> German
154 u grave <CTRL><SHIFT><;> British <CTRL><SHIFT><Ö> German
155 u circumflex <CTRL><;> British <CTRL><Ö> German
156 á (beta/sz) <CTRL><SHIFT><,> British <á> German
157 cent symbol <CTRL><=> British <CTRL><SHIFT><G> German
158 yen symbol <CTRL><SHIFT><.>
159 backquote <CTRL><SHIFT></> British <CTRL><SHIFT><-> German
160 A umlaut <CTRL><SHIFT><2> British <SHIFT><Ä> German
161 A tilde <CTRL><SHIFT><A>
162 A circle <CTRL><SHIFT><B>
163 E acute <CTRL><SHIFT><C>
164 O umlaut <CTRL><SHIFT><D> British <SHIFT><Ö> German
165 O tilde <CTRL><SHIFT><E>
166 O bar <CTRL><SHIFT><F>
167 U umlaut <CTRL><SHIFT><G> British <SHIFT><Ü> German
168 C cedilla <CTRL><SHIFT><H>
169 N tilde <CTRL><SHIFT><I>
170 AE diphthong <CTRL><SHIFT><J>
171 OE diphthong <CTRL><SHIFT><K>
172 lower alpha <CTRL><SHIFT><L>
173 lower delta <CTRL><SHIFT><M>
174 upper theta <CTRL><SHIFT><N>
175 lower lambda <CTRL><SHIFT><O>
176 lower mu <CTRL><SHIFT><P>
177 lower pi <CTRL><SHIFT><Q>
178 upper phi <CTRL><SHIFT><R>
179 inverse ! <CTRL><SHIFT><S>
180 inverse ? <CTRL><SHIFT><T>
181 script mark <CTRL><SHIFT><U>
182 section symbol <CTRL><SHIFT>(V):sup:British <SHIFT><3> German
183 cross-circle <CTRL><SHIFT><W>
184 French quote <CTRL><SHIFT><X>
185 French quote <CTRL><SHIFT><Y> British <CTRL><SHIFT><Z> German
186 ø (degree) <CTRL><SHIFT><Z> British <CTRL><SHIFT><Y> German
187 division <CTRL><[> British <CTRL><Ü> German
188 left arrow <CTRL><\> British <CTRL><SHIFT><2> German
189 right arrow <CTRL><]> British <CTRL><+> German
190 up arrow <CTRL><SHIFT><6>
191 down arrow <CTRL><SHIFT><-> British <CTRL><SHIFT><á> German
192 up-left arrow <LEFT>
193 up-right arrow <ALT><LEFT>
194 down-left arrow <CTRL><LEFT>
195 down-right arrow <CTRL><ALT><LEFT>
196 upper delta <SHIFT><LEFT>
197 small eta <ALT><SHIFT><LEFT>
198 large upper phi <CTRL><SHIFT><LEFT>
199 upper gamma <ALT><CTRL><SHIFT><LEFT>
200 spades <RIGHT>
201 hearts <ALT><RIGHT>
202 diamonds <CTRL><RIGHT>
203 clubs <ALT><CTRL><RIGHT>
204 upper lambda <SHIFT><RIGHT>
205 inverse upper delta <ALT><SHIFT><RIGHT>
206 infinity <CTRL><SHIFT><RIGHT>
207 upper omega <ALT><CTRL><SHIFT><RIGHT>
208 upper pi <UP>
209 upper psi <ALT><UP>
210 registered <CTRL><UP>
211 upper sigma <ALT><CTRL><UP>
212 upper theta <SHIFT><UP>
213 upper upsilon <ALT><SHIFT><UP>
214 dagger <CTRL><SHIFT><UP>
215 double dagger <ALT><CTRL><SHIFT><UP>
216 upper xi <DOWN>
217 plus minus <ALT><DOWN>
218 [unknown] <CTRL><DOWN>
219 exactly equal <ALT><CTRL><DOWN>
220 less or equal <SHIFT><DOWN>
221 not equal <ALT><SHIFT><DOWN>
222 greater or equal <CTRL><SHIFT><DOWN>
223 approximately equal <ALT><CTRL><SHIFT><DOWN>
224 empty square <CAPS>
225 filled square <ALT><CAPS>
226 filled circle <CTRL><CAPS>
227 lower chi <ALT><CTRL><CAPS>
228 differential/del <SHIFT><CAPS>
229 element-of <ALT><SHIFT><CAPS>
230 FR (French Francs) <CTRL><SHIFT><CAPS>
231 lower gamma <ALT><CTRL><SHIFT><CAPS>
232 upper kappa <F1>
233 lower iota <CTRL><F1>
234 vertical line <SHIFT><F1>
235 lower kappa <CTRL><SHIFT><F1>
236 one-quarter <F2>
237 one-half <CTRL><F2>
238 three-quarters <SHIFT><F2>
239 lower omega <CTRL><SHIFT><F2>
240 lower psi <F3>
241 => (conclusion) <CTRL><F3>
242 lower rho <SHIFT><F3>
243 lower sigma <CTRL><SHIFT><F3>
244 lower tau <F4>
245 lower upsilon <CTRL><F4>
246 square root <SHIFT><F4>
247 cubic root <CTRL><SHIFT><F4>
248 lower xi <F5>
249 … (three dots) <CTRL><F5>
250 lower zeta <SHIFT><F5>
251 integral head <CTRL><SHIFT><F5>
252 integral middle <SHIFT><SPACE>
253 integral foot <SHIFT><TAB>
254 random pattern <SHIFT><ENTER>
255 regular pattern ( <ALT> )

*) Yes, there are in fact three kinds of phi!

Note that CHR$(255) is used whenever a character code is undefined.

To make matters worse, the JS ROM makes a distinction between <CTRL><ESC> with and without caps lock (the former is equivalent to <CTRL><SHIFT><ESC>.

To see Minerva’s pattern character assigned to CHR$(255), try the following lines. Changing the CHAR_INC parameters is fun, or add OVER 1 at line 100…

100 CHAR_INC 6,9: CLS
110 FOR i=1 TO 10: PRINT FILL$(CHR$(255),30)

If you are designing a program which should work (without annoying the user) on all QLs and keyboards then avoid all of the above codes which are shown as being different on British and German QLs. Alternatively, you could make your program fully configurable for these keys, or store all of the different keyboard layouts in your program so that it will adapt itself to the machine on which it is working - the latter is however much work.

A9.2 Keyboard Layouts

As more and more QL Emulators appear as well as keyboard interfaces, it becomes increasingly difficult to list the standard keyboard layouts which will be available to a QL user. Instead, we have listed here the layouts used in the most common countries on a standard QL machine (as supplied by Sinclair).

British QL

F1     ESC  1   2   3   4   5   6   7   8   9   0   -   =   £   \
F2     TAB    Q   W   E   R   T   Y   U   I   O   P   [   ]
F3     CAPS    A   S   D   F   G   H   J   K   L   ;   '      ENTER
F4     SHIFT     Z   X   C   V   B   N   M   ,   .   /     SHIFT
F5     CTRL  LEFT RIGHT          SPACE             UP  DOWN   ALT

German QL

F1     ESC  1   2   3   4   5   6   7   8   9   0   á   #   \   <
F2     TAB    Q   W   E   R   T   Z   U   I   O   P   Ü   +
F3     CAPS    A   S   D   F   G   H   J   K   L   Ö   Ä      ENTER
F4     SHIFT     Y   X   C   V   B   N   M   ,   .   -     SHIFT
F5     CTRL  LEFT RIGHT          SPACE             UP  DOWN   ALT

French QL

F1     ESC  1   2   3   4   5   6   7   8   9   0   -   =   ^   ù
F2     TAB    A   Z   E   R   T   Y   U   I   O   P   é   è
F3     CAPS    Q   S   D   F   G   H   J   K   L   M   à      ENTER
F4     SHIFT     W   X   C   V   B   N   ,   .   ;   ç     SHIFT
F5     CTRL  LEFT RIGHT          SPACE             UP  DOWN   ALT

Swedish QL

F1     ESC  1   2   3   4   5   6   7   8   9   0   +   '   |   <
F2     TAB    Q   W   E   R   T   Y   U   I   O   P   Å   *
F3     CAPS    A   S   D   F   G   H   J   K   L   Ö   Ä      ENTER
F4     SHIFT     Z   X   C   V   B   N   M   ,   .   -     SHIFT
F5     CTRL  LEFT RIGHT          SPACE             UP  DOWN   ALT

Finnish QL

F1     ESC  1   2   3   4   5   6   7   8   9   0   +   '   |   <
F2     TAB    Q   W   E   R   T   Y   U   I   O   P   Å   ^
F3     LUKITUS A   S   D   F   G   H   J   K   L   Ö   Ä      ENTER
F4     VAIHTO   Z   X   C   V   B   N   M   ,   .   -      VAIHTO
F5     OHJAUS LEFT RIGHT         SPACE            UP DOWN     SIIRTO

Danish QL

F1     ESC  1   2   3   4   5   6   7   8   9   0   =   +   /  DEL
F2     TAB    Q   W   E   R   T   Y   U   I   O   P   Å   "
F3     LOCK    A   S   D   F   G   H   J   K   L   ’   \      ENTER
F4     SHIFT    Z   X   C   V   B   N   M   ,   .   -      SHIFT
F5     CTRL  LEFT RIGHT          SPACE             UP  DOWN   ALT