Keyboard Connection Grid(using matching DB25 connector numbers)
K E Y S 400/800/XL Pin
DEL > < 0 9 8
7 BRK 1
ESC 1 2 3 4 5
6
2
RET = - P O I
U
3
TAB Q W E R T
Y
4

* + ; L K J
CTRL 5
CAPS A S D F G H

6

INV / . , M SPC N
7

Z X C V B

SHIFT 8
17 16 15 14 13 12 11 10 9
F U N C T I O N - K E Y S / L E D 400/800 Pin XL Pin
HELP RESET
OPTION SELECT START
LED GND


18
19 20 21

22 22

23
20 21 22
24 18
18
17








19
In Testing an 800XL extension keyboard with an 800,
I had to change switch connections to the following db25 pins:
17 23

22
21
20

24
18

18

800 Connector(viewd from bottom)
Left(1) - - - - - - - - - - - - - - - - - - - - - - - - (17)Right

XL Connector
Back(1) - - - - - - - - - - - - - - - - - - - - - - - - (24)Front


Keyboard Internal Number Grid
K E Y S
X S RRR CCC
(location 764)
< 8 to 3
<encoder
(CCC)
b0 b1 b2 b3 b4 b5 b6 b7
^^^^^^^^
8 to 3 encoder
(RRR)
b0 L
0
J
1
;
2


K
5
+
6
*
7
Normally-value is 255, so all bits are high b1 O
8

P
10
U
11
EOL
12
I
13
-
14
=
15
bits 2-0 from
columns

b2 V
16

C
18


B
21
X
22
Z
23
bits 5-3 from
rows

b3 4
24

3
26
6
27
ESC
28
5
29
2
30
1
31



b4 ,
32
SPC
33
.
34
N
35

M
37
/
38
ATARI
39
'S' bit is low when shift is pressed

b5 R
40

E
42
Y
43
TAB
44
J
45
W
46
Q
47
'X' bit is low when ctrl is pressed

b6 9
48

0
50
7
51
BACK
52
8
53
<
54
>
55



b7 F
56
H
57
D
58

CAPS
60
G
61
S
62
A
63

(NOTE:that with shift and crtl not pressed, letters above are lower case.)

Keyboard Internal Number Grid
K E Y S -- with shift pressed
X S RRR CCC
(location 764)
< 8 to 3
<encoder
(CCC)
b0 b1 b2 b3 b4 b5 b6 b7
^^^^^^^^
8 to 3 encoder
(RRR)
b0

:
66



\
70
^
71
Normally-value is 255, so all bits are high b1





UND
78
|
79
bits 2-0 from
columns

b2







bits 5-3 from
rows

b3 $
88

#
90
&
91

%
93
"
94
!
95



b4 [
96

]
98



?
102

'S' bit is low when shift is pressed

b5







'X' bit is low when ctrl is pressed

b6 (
112

)
114
'
115
del
116
@
117
CLR
118
INS
119



b7








(NOTE:this table only shows characters not in previous table.)



Cross reference XE to XL pin numbers
XE Key pin numbers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
19 24 18 11 7 8 5 12 13 14 15 3 1 2 4 17 16 6 10 9 20 21 22 23
XL Key pin numbers


It is very easy to use the keycodes in a program. This lets you scan for keypresses while doing something else.
10 NBR=PEEK(764)
20 IF NBR<>255 THEN POKE 764,255
30 REM THIS MAKES SURE THE VALUE DOES NOT INTERFERE LATER. AND THERE IS NO KEYCLICK THAT INTERFERES WITH DLIS.
40 REM YOU CAN USE: 20 OPEN #4,4,0,"K:":GET #4,X:CLOSE #4 ..YOU GET ATASCII, BUT YOU GET A KEYLICK TOO
50 IF NBR=28 THEN GOTO MENU:REM ON ESCAPE
60 IF NBR=12 THEN QUIT:REM ON RETURN
.
90 REM you can even scan the shift/ctrl/option/select/start/help buttons
100 REM DO YOUR ROUTINE HERE
1000 GOTO 10

You might think that you could use an 8X8 array to look up the atascii value for the keycode value, and you can but you use 384 bytes + code, and its slow.

Better to DIM KEYCODE$(256) and put the atascii values in the slot for its keycodes using data statements. And then all you have to do is look it up.(ATASCII=ASC(KEYCODES$(NBR+1))

I prefer to just use the keycodes and save the work of converting to atascii unless I really have to(when I input to a string, I use OPEN to get atascii instead).

Rick D.

(Jan05, revised Oct06)