A calculator keyboard gets scanned to see which, if any, key has been pressed.
It is a fairly simple process. The calculator activates each keyboard row in turn, and checks to see if a signal appears in any of the columns. Each key connects a different row to a different column. It looks like this:
(from HP Journal, 1975-11, page 9)
There’s up to 5 keys across, and there’s 7 rows of keys.
The ENTER key is always the first key (LHS) on the third row (from the top). It is a wide key, that occupies two positions on the grid. I’m not sure of the exact mechanics, but it only presses the first switch. The other three keys on the same row appear in the third, fourth and fifth columns.
The row values (top to bottom) are: 0xb0, 0x40, 0xd0, 0x60, 0xa0, 0x70 and 0x90.
The column values (L->R) are: 3, 2, 1, 0 and 4.
This means the ENTER key causes a scan code of (row 3 + col 1) 0xd0 + 3 or 0xd3.
In the microcode, when the calculator does a “keys -> a” instruction and the ENTER key has been pressed, 0xd appears in A and 0x3 appears in A.
This means the scancodes are:
These are the same scancodes for the button positions, as those used for the HP25.
This is part of the HP-29 topic.