### Events

Events are messages sent to the event endpoint (`-event` or Debug → Event...) about various emulated physical devices like the drives, cassette or keyboard. You might want to watch them for high-level debugging or send them to a program which blinks real LEDs or something.

Event messages are send one per line and are simple ASCII text:

dN
  Floppy drive N is now active. `d-1` means no floppy drive is active.
sN
  The active floppy drive has seeked to track N.
hN
  Hard drive N is now active. `h-1` means no hard drive is active.
eN
  The active hard drive has seeked to track N.
c1
  The cassette relay has turned on.
c0
  The cassette relay has turned off.
p1
  Data is being send to the printer.
p0
  No data is being send to the printer.
kRCS
  The key at row R and column C has been pressed (S=1) or released (S=0). For example, if the `A` key is tapped on a Model 1 a `k011` message will be sent followed closely by a `k010`. See the keyboard matrices below for how to map row and column numbers to keys for each model.
r1
  The reset button has been pressed.
r0
  The reset button has been released.

#### Keyboard Matrices

Not all models have keyboards and others like the DT-1 and Model 2/12/16/6000 family are not yet emulated at the keyboard matrix level. These models do not generate keyboard events.

Model I Keyboard Matrix

| Column
--- | ---
Row | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
0 | @ | A | B | C | D | E | F | G
1 | H | I | J | K | L | M | N | O
2 | P | Q | R | S | T | U | V | W
3 | X | Y | Z
4 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
5 | 8 | 9 | : | ; | , | - | . | /
6 | Enter | Clear | Break | ↑ | ↓ | ← | → | Space-Bar
7 | Shift

Model III Keyboard Matrix

| Column
--- | ---
Row | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
0 | @ | A | B | C | D | E | F | G
1 | H | I | J | K | L | M | N | O
2 | P | Q | R | S | T | U | V | W
3 | X | Y | Z
4 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
5 | 8 | 9 | : | ; | , | - | . | /
6 | Enter | Clear | Break | ↑ | ↓ | ← | → | Space-Bar
7 | Left Shift | Right Shift

Model 4 Keyboard Matrix

| Column
--- | ---
Row | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
0 | @ | A | B | C | D | E | F | G
1 | H | I | J | K | L | M | N | O
2 | P | Q | R | S | T | U | V | W
3 | X | Y | Z
4 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
5 | 8 | 9 | : | ; | , | - | . | /
6 | Enter | Clear | Break | ↑ | ↓ | ← | → | Space-Bar
7 | Left Shift | Right Shift | Ctrl | Caps | F1 | F2 | F3

Japanese Model I Keyboard Matrix

| Column
--- | ---
Row | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
0 | ﾟ @ ﾞ | A ﾁ | B ｺ | C ｿ | D ｼ | ｨ E ｲ | F ﾊ | G ｷ
1 | H ｸ | I ﾆ | J ﾏ | K ﾉ | L ﾘ | M ﾓ | N ﾐ | O ﾗ
2 | P ｾ | Q ﾀ | R ｽ | S ﾄ | T ｶ | U ﾅ | V ﾋ | Wﾃ
3 | X ｻ | Y ﾝ | ｯ Z ﾂ | 0 | 1 | 2 | 3 | 4
4 | ｦ 0 ﾜ | ! 1 ﾇ | " 2 ﾌ | # ｧ 3 ｱ | $ ｩ 4 ｳ | % ｪ 5 ｴ | & ｫ 6 ｵ | ' ｬ 7 ﾔ
5 | ( ｢ 8 ﾕ | ( ｮ 9 ﾖ | * ｢ : ｹ | + ; ﾚ | < ､ , ﾈ | = - ﾎ | > ｡ . ﾙ | ? ･ / ﾒ
6 | Enter | ｣ clearﾑ | Break | ↑ | ↓ | ← | → ﾛ | Space-Bar
7 |  | ｰ ¥ ﾍ | 5 | 6 | 7 | 8 | 9 | .
8 | Shift
9 | 英数 カナ

Note the keys marked 0 .. 9 and . are on the numeric keypad which can be read independently on the Japanese Model I. The numeric keybord is wired in parallel with the main keyboard on the original Model I (and 3 and 4).

Videotex/CoCo matrix

| Column
--- | ---
Row | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
0 | @ | A | B | C | D | E | F | G
1 | H | I | J | K | L | M | N | O
2 | P | Q | R | S | T | U | V | W
3 | X | Y | Z | ↑ | ↓ | ← | → | Space-Bar
4 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
5 | 8 | 9 | : | ; | , | - | . | /
6 | Enter | Clear | Break |  |  |  |  | Shift

MC-10 Keyboard Matrix

| Column
--- | ---
Row | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
0 | @ | A ▚ | B | C ▖ | D ▟ | E ▜ | F ▞ | G ▐
1 | H | I | J | K | L | M | N | O
2 | P | Q █ | R ▀ | S ▘ | T ▙ | U | V ▗ | W ▛
3 | X ▄ | Y ▌ | Z ▝ |  |  |  | Enter | Space-Bar
4 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
5 | 8 | 9 | : | ; | , | - | . | /
6 | Control |  | Break |  |  |  |  | Shift