Author Topic: 122-key Unicomp, all scancodes?  (Read 34578 times)

0 Members and 1 Guest are viewing this topic.

Offline JohnElliott

  • Posts: 109
122-key Unicomp, all scancodes?
« Reply #50 on: Fri, 13 August 2010, 02:29:32 »
Quote from: dfj;212014
PS under the enter, where one might want to put a \| is 5D, F0 5D like you guessed, but under the backspace: E0 27, E0 F0 27

As you put it L7, or AT F-7, has that crazy shift-7C sequence. not certain how you normally encode long strings like pause, etc... huh - interesting, I never noticed - pause can be thought of as right-ctrl, num-lock, num-lock-break, right-ctrl-break


I've now updated the diagram with those two keys.

If a key produces a sequence of scancodes that isn't just 'xx' or 'E0 xx' I tend to show the bit of the sequence that isn't fake Shift or Ctrl keys, colour the key in, and describe what it actually does in the surrounding text.

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
confirmation of my earlier post regarding the unicomp in mode 3.
« Reply #51 on: Fri, 13 August 2010, 10:06:41 »
I did another pass of the keys in  mode three, without jumper 3:

There are three differences from the 1390876 in scan-code mode 3:
under the right shift has a different code, as does the pad under the keypad 0. The keypad-enter does not seem to have an extra pad under it.

This is the set I will be using, though I'll wager the mode 2 sans-jumper-3 could likely be made to work well with windows and AHK without much trouble, excepting the pause and print-screen, which might be hard to move.

enjoy,
dfj

Code: [Select]

top fct keys:
TF-13                               08            08  F0 08              
TF-14                               10            10  F0 10
TF-15                               18            18  F0 18
TF-16                               20            20  F0 20
TF-17                               28            28  F0 28
TF-18                               30            30  F0 30
TF-19                               38            38  F0 38
TF-20                               40            40  F0 40
TF-21                               48            48  F0 48
TF-22                               50            50  F0 50
TF-23                               57            57  F0 57
TF-24                               5F            5F  F0 5F


TF-1                                07            07  F0 07
TF-2                                0F            0F  F0 0F
TF-3                                17            17  F0 17
TF-4                                1F            1F  F0 1F
TF-5                                27            27  F0 27
TF-6                                2F            2F  F0 2F
TF-7                                37            37  F0 37
TF-8                                3F            3F  F0 3F
TF-9                                47            47  F0 47
TF-10                               4F            4F  F0 4F
TF-11                               56            56  F0 56
TF-12                               5E            5E  F0 5E


left fct keys:
LF-1                                05            05   F0 05
LF-2                                06            06   F0 06
LF-3                                04            04   F0 04
LF-4                                0C            0C   F0 0C
LF-5                                03            03   F0 03
LF-6                                0B            0B   F0 0B
LF-7                                83            83   F0 83
LF-8                                0A            0A   F0 0A
LF-9                                01            01   F0 01
LF-10                               09            09   F0 09


main text area:
`/~                                 0E            0E  F0 0E
KB-1                                16            16  F0 16
KB-2                                1E            1E  F0 1E
KB-3                                26            26  F0 26
KB-4                                25            25  F0 25
KB-5                                2E            2E  F0 2E
KB-6                                36            36  F0 36
KB-7                                3D            3D  F0 3D
KB-8                                3E            3E  F0 3E
KB-9                                46            46  F0 46
KB-0                                45            45  F0 45
KB--                                4E            4E  F0 4E
KB-=                                55            55  F0 55
u-backspc                           5D            5D  F0 5D  
Backspace                           66            66  F0 66

tab                                 0D            0D  F0 0D
q                                   15            15  F0 15
w                                   1D            1D  F0 1D
e                                   24            24  F0 24
r                                   2D            2D  F0 2D
t                                   2C            2C  F0 2C
y                                   35            35  F0 35
u                                   3C            3C  F0 3C
i                                   43            43  F0 43
o                                   44            44  F0 44
p                                   4D            4D  F0 4D
{                                   54            54  F0 54
}                                   5B            5B  F0 5B
\|                                  5C            5C  F0 5C

capslock                            14            14  F0 14
a                                   1C            1C  F0 1C
s                                   1B            1B  F0 1B
d                                   23            23  F0 23
f                                   2B            2B  F0 2B
g                                   34            34  F0 34
h                                   33            33  F0 33
j                                   3B            3B  F0 3B
k                                   42            42  F0 42
l                                   4B            4B  F0 4B
;                                   4C            4C  F0 4C
'/"                                 52            52  F0 52
}/{ (under enter on US)             53            53  F0 53
enter                               5A            5A  F0 5A

L-shift                             12            12  F0 12
>/<                                 13            13  F0 13
z                                   1A            1A  F0 1A
x                                   22            22  F0 22
c                                   21            21  F0 21
v                                   2A            2A  F0 2A
b                                   32            32  F0 32
n                                   31            31  F0 31
m                                   3A            3A  F0 3A
,                                   41            41  F0 41
.                                   49            49  F0 49
/                                   4A            4A  F0 4A
u-r-shift                           51            68  F0 68 <-- different
r-shift                             59            59  F0 59

L-CTRL                              11            11  F0 11
l-alt                               19            19  F0 19
space                               29            29  F0 29
R-alt                               39            39  F0 39
R-ctrl                              58            58  F0 58


cursor-pad area:
insert                              67            67  F0 67
home                                6E            6E  F0 6E
pg-up                               6F            6F  F0 6F

delete                              64            64  F0 64
end                                 65            65  F0 65
pg dn                               6D            6D  F0 6D

cp-up                               63            63  F0 63

cp-left                             61            61  F0 61
cp-rule                             62            62  F0 62
cp-right                            6A            6A  F0 6A

cp-down                             60            60  F0 60


number-pad area:
np-num-lock                         76            76  F0 76
np-/                                77            77  F0 77
np-*                                7E            7E  F0 7E
np--                                84            84  F0 84

np-7                                6C            6C  F0 6C
np-8                                75            75  F0 75
np-9                                7D            7D  F0 7D
np+/field-                          7C            7C  F0 7C

np-4                                6B            6B  F0 6B
np-5                                73            73  F0 73
np-6                                74            74  F0 74
np-field+                           7B            7B  F0 7B

np-1                                69            69  F0 69
np-2                                72            72  F0 72
np-3                                7A            7A  F0 7A
np-enter                            79            79  F0 79

u-np-0                              68            78  F0 78 <-- different
np-0                                70            70  F0 70
np-.                                71            71  F0 71
u-np-enter                          78            --        <-- different.
           
[/B]
Fave Switch manus: IBM, Topre, Matias, ...

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
1397000 scan-table?
« Reply #52 on: Fri, 13 August 2010, 10:44:26 »
Quote from: ripster;212197
So to summarize for us mere humans it seems removing the Boscom/Unicom J3 jumper makes the Boscom/Unicomp act like a IBM/Lexmark Model M 1397000.   At least at first pass looking at the scan codes.

Dang, I have no clue what codes the 1397000 puts out - anyone done a full audit? My google-fu is weak. :(

dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
possible conclusion.
« Reply #53 on: Fri, 13 August 2010, 10:56:52 »
It appears that without that jumper, these keyboards are a NIB, currently manufactured, alternative to the old IBM terminal boards.
  They can even be had with sparkly keys. o.0

I'm not overly curious what is on that eeprom - my fear is that it is 1/2 of the matrix decoding logic, rather than anything sane. I only have my board back until monday, so I may or may not have time to pull it.

  enjoy yer boscoms, unicomps and 7000s folks.

dfj out
Fave Switch manus: IBM, Topre, Matias, ...

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
122-key Unicomp, all scancodes?
« Reply #54 on: Fri, 13 August 2010, 11:19:47 »
Quote from: ripster;212211
No google needed. It's in the 1397000 link.
bah, I read through the whole thing, even followed to dw_junion's post (he had a few scattered codes, already eaten by the i8042, though.)

I must be daft. :(

If we find them, I'll edit this post to stuff them in, to save the next daft sucker the effort of looking. :)

dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline JohnElliott

  • Posts: 109
122-key Unicomp, all scancodes?
« Reply #55 on: Fri, 13 August 2010, 17:06:12 »
Quote from: dfj;212193
I did another pass of the keys in  mode three, without jumper 3:

There are three differences from the 1390876 in scan-code mode 3:
under the right shift has a different code, as does the pad under the keypad 0. The keypad-enter does not seem to have an extra pad under it.


And here's the corresponding picture.

Offline JohnElliott

  • Posts: 109
122-key Unicomp, all scancodes?
« Reply #56 on: Fri, 13 August 2010, 17:09:16 »
Quote from: dfj;212208
I'm not overly curious what is on that eeprom - my fear is that it is 1/2 of the matrix decoding logic, rather than anything sane. I only have my board back until monday, so I may or may not have time to pull it.


If you don't, perhaps Ripster's Boscom controller could be induced to give up its EEPROM for the cause of [strike]mad[/strike] science?

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
bah
« Reply #57 on: Sat, 14 August 2010, 12:23:27 »
Quote from: JohnElliott;212382
If you don't, perhaps Ripster's Boscom controller could be induced to give up its EEPROM for the cause of [strike]mad[/strike] science?
 I've got one of them multi-pin clamp-style connectors, and I've got the keyboard for a bit longer to do a bolt-mod.
  I'll try harder to take a shot at it.

 Someone had a board less the chip? Not sure how that works, exactly. I also have no clue what the first two jumpers do yet - haven't noticed any effects from them.

dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline mike

  • Posts: 82
122-key Unicomp, all scancodes?
« Reply #58 on: Sat, 14 August 2010, 13:24:06 »
Well I've finished off my blog posting on re-mapping this keyboard (http://really.zonky.org/?p=1125) - finished off mapping out the scancodes and keycodes with the exception of the QWERTY pad (which is not so interesting) plus dealing with keymapping for X.

There's something odd going on with the Record key - once it has been pressed, some of the other keys send their own keycode followed by the Record keycode. Some sort of terminal feature ?
Keyboards: Unicomp UB40T56 with JP3 removed, Unicomp UB4044A, Filco Tenkeyless Brown (with pink highlights), Access AKE1223231, IBM DisplayWriter, Das Keyboard III, and a few others.

Offline JohnElliott

  • Posts: 109
122-key Unicomp, all scancodes?
« Reply #59 on: Sat, 14 August 2010, 14:07:36 »
Quote from: mike;212593
Well I've finished off my blog posting on re-mapping this keyboard (http://really.zonky.org/?p=1125) - finished off mapping out the scancodes and keycodes with the exception of the QWERTY pad (which is not so interesting) plus dealing with keymapping for X.

There's something odd going on with the Record key - once it has been pressed, some of the other keys send their own keycode followed by the Record keycode. Some sort of terminal feature ?


The "E02A" that the Record key produces is fake-Shift. If you assign a keycode to that, you'll get it reported on any other key that generates fake-Shift. The sequence E02A,E037 that you've documented is produced by PrintScreen on a normal 101-key or 102-key board; and, indeed, on my Affirmative the PrintScreen key is in the L7 position, where your Record key is.

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
Mode 2 vs Mode 3.
« Reply #60 on: Sat, 14 August 2010, 14:40:54 »
Quote from: JohnElliott;212600
The "E02A" that the Record key produces is fake-Shift. If you assign a keycode to that, you'll get it reported on any other key that generates fake-Shift. The sequence E02A,E037 that you've documented is produced by PrintScreen on a normal 101-key or 102-key board; and, indeed, on my Affirmative the PrintScreen key is in the L7 position, where your Record key is.

Thanks fer the updated pic!

And now you folks see why I find mode-2 so much fun, and thus prefer mode 3. At least when I get to be the byte consumer...
 
OTOH:
 Trying to hack terminal mode 3 into the 'dose driver is a lot hurty.
I'm pretty sure that a filter-driver won't cut it, since the kb will already be harassed into lala-land by the time the init-callback takes place. If the event call-back is in place first, then one can filter the calls a bit I hope.
 Alternately, one could reset the keyboard at the init-callback and try again... stuff to experiment with if one likes windows driver dev. :)

  This approach doesn't get around my fundamental beef, though, which is that more and more computers are being made without PS2 ports, and the USB converters don't give one a virtual PS2 - they give one a HID device and typically only know how to eat 102-5 keyboards. Alternately, the PS2 controllers on some modern boards are pissy (especially the shared kb/mouse trick ones), and get grumpy if they don' see a canonical 102-5 keyboard on the port. Then yer drivers don't matter - the mainboard is claiming there _is no keyboard_.

Bah,
Back to trying to get boot-mode working in me firmware. I busted it at some point recently,
dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline mike

  • Posts: 82
122-key Unicomp, all scancodes?
« Reply #61 on: Sun, 15 August 2010, 14:43:58 »
Quote from: JohnElliott;212600
The "E02A" that the Record key produces is fake-Shift.


Aha! I would say that makes sense, but it really doesn't ... I wouldn't be at all surprised if the committee that designed scan code set 2 always met in the afternoon after long liquid lunches :)

Corrected that minor point.
Keyboards: Unicomp UB40T56 with JP3 removed, Unicomp UB4044A, Filco Tenkeyless Brown (with pink highlights), Access AKE1223231, IBM DisplayWriter, Das Keyboard III, and a few others.

Offline JohnElliott

  • Posts: 109
122-key Unicomp, all scancodes?
« Reply #62 on: Sun, 15 August 2010, 17:07:03 »
Quote from: mike;212868
Aha! I would say that makes sense, but it really doesn't ... I wouldn't be at all surprised if the committee that designed scan code set 2 always met in the afternoon after long liquid lunches :)


The whole thing about set 2 is it's trying to be backward-compatible with the 84-key AT keyboard, so that if you plug an enhanced keyboard into an AT the extra keys still do what they should. On the AT, PrintScreen is Shift + Keypad *: 2A 37. The enhanced keyboard then added a separate PrintScreen key, which produces the sequence E02A E037. The AT ignores the E0s and you get the right effect. A computer that recognises the E0s can distinguish between the two keys and ignore the fake Shift.

Similarly, Pause: E11D 45. On an AT, the E1s are ignored and you get 1D 45: Ctrl + NumLock.

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
122-key Unicomp, all scancodes?
« Reply #63 on: Sun, 15 August 2010, 17:27:08 »
Quote from: JohnElliott;212879
The whole thing about set 2 is it's trying to be backward-compatible with the 84-key AT keyboard, so that if you plug an enhanced keyboard into an AT the extra keys still do what they should. On the AT, PrintScreen is Shift + Keypad *: 2A 37. The enhanced keyboard then added a separate PrintScreen key, which produces the sequence E02A E037. The AT ignores the E0s and you get the right effect. A computer that recognises the E0s can distinguish between the two keys and ignore the fake Shift.

Similarly, Pause: E11D 45. On an AT, the E1s are ignored and you get 1D 45: Ctrl + NumLock.

  OK - this is quite useful, I didn't know that the AT would ignore the E0 and E1 prefixes - much more makes sense now.

yup,
dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline xwhatsit

  • Thread Starter
  • Posts: 297
  • Location: NZ
122-key Unicomp, all scancodes?
« Reply #64 on: Tue, 17 August 2010, 17:03:20 »
There's some very good stuff in this thread. Opens up a few more eBay options should the need arise!

My Unicomp board is currently being manufactered, will be on its way soon. Cool bananas.
Beam spring IBM 5251 (7361073/7362149) & IBM 3727 (5641316) | Model F IBM 122-key terminal & IBM PC-AT 84-key | Model M Unicomp 122-key terminal | Cherry MX Blue Leopold Tenkeyless

Offline xwhatsit

  • Thread Starter
  • Posts: 297
  • Location: NZ
122-key Unicomp, all scancodes?
« Reply #65 on: Sun, 22 August 2010, 23:10:13 »
Awesome, keyboard arrived, FedEx was cheap and arrived sooner than expected so happy.

What a solid board! Jesus.

Key weight actually a bit lighter than I was expecting, but getting used to it. Would be nicer if it were a shade heavier though.

Co-workers getting pissed with the noise already. Excellent.

Thank-you to the contributors to this thread -- I have all the extra keys working under Linux now. Used the atkbd.softraw=0 option to be able to see all the keys. Remapped the keys in a similar way to Mike's blog article. Why exactly is it that the setkeycode output is different from what X sees?

Anyway all is working well. Very pleased! Thanks all!
Beam spring IBM 5251 (7361073/7362149) & IBM 3727 (5641316) | Model F IBM 122-key terminal & IBM PC-AT 84-key | Model M Unicomp 122-key terminal | Cherry MX Blue Leopold Tenkeyless

Offline mike

  • Posts: 82
122-key Unicomp, all scancodes?
« Reply #66 on: Tue, 24 August 2010, 15:12:58 »
Not sure why something adds 8 to the keycodes for X, but it seems that the first 8 keycodes are reserved for some reason :-

% DISPLAY=:0 xdpyinfo | grep key
keycode range:    minimum 8, maximum 255

Did a little searching with no results as to why this may be ... nothing immediately obvious although I didn't spend much time on it.
Keyboards: Unicomp UB40T56 with JP3 removed, Unicomp UB4044A, Filco Tenkeyless Brown (with pink highlights), Access AKE1223231, IBM DisplayWriter, Das Keyboard III, and a few others.

Offline xiphmont

  • Posts: 13
Dump of the EEPROM
« Reply #67 on: Sun, 27 October 2013, 14:56:15 »
I'm probably going to start a new thread once I do some more thorough analysis, but since I came to this thread looking for the contents of the little U3 EEPROM and eventually just ended up dumping it myself, I thought I'd up here for now: * unicomp.bin (2 kB - downloaded 196 times.)

The arrangement is a bit odd. Addresses 0x000-0x0ff looks like a 128 entry 16 bit big endian translation table (even bytes always 0x00).  Whatever it is, it's not in scancode order and it doesn't appear to follow any natural arrangement on the physical matrix either,  so I assume the translation is being done according to some internal key position representation.  I haven't dug into it too far yet.

Hex 0x100-0x2ff appears to be a jump table in the same order as the translation table, but each entry is four bytes wide (again with even bytes 0x00).  The translated function keys are clearly visible here.

Hex 0x300-0x4ff is empty; it's coincidentally enough space for a second jump table.  I'll try that at some point.

Octal 0x500 is the start of the jump table entries.  The jump table contents that are present are obvious enough: A sequence of Set 2 make and break codes.

The keyboard identification code (0xab 0x83) is at 0x7e0, 0x7e2.  The 0xaa at 0xe4 is an OK code?

This was a board (Unicomp P/N 01U1117) with controller 03U0508 out of a BOSCOM keyboard.  It has J3 and a soldered-in CSI 93C86 EEPROM.  I pulled the EEPROM to read it, replaced it with a socket, and tested that a copy into another 93C86 worked as expected.  J3 present enables the Shift+foo and Alt+foo translations of keys like the function keys.  Removing the jumper results in getting all 122 unique scancodes.  Removing the EEPROM entirely seems to function the same as removing the jumper.  I haven't inspected carefully to see if there are any hidden differences in what the keyboard is returning on the wire when the EEPROM is gone as opposed to just jumpered.  As someone else already noted, J3 does not tie to an enable pin-- when present, it sets the EEPROM into 8 bit mode, and when absent it set the EEPROM to 16 bit mode.  I have no idea if this is some kind of cute bank-switching hack that ended up not being used, or was intended as a way of disabling the EEPROM (the controller certainly has the ability to notice the serial timing differences between the two EEPROM modes and adjust how it talks to it, even if it can't see the jumper itself).  Especially weird since it seems to mostly use even addressing, ie, it's set up so it would get consistent results with a little fiddling in either mode.

[edit: I originally had the endianness swapped due to pilot error in my hex editor, and hex addressing is probably easier to read for most of us than octal]
« Last Edit: Sun, 27 October 2013, 17:03:25 by xiphmont »

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
Re: 122-key Unicomp, all scancodes?
« Reply #68 on: Mon, 28 October 2013, 16:10:03 »
Interesting - not sure what the eeprom looks like in detail, I haven't opened it in hex yet. :p
However - these are the 122 key mode 3 scancodes arranged by the matrix of a 122 F:
Column is row, row is column since I scan by column. Notice that the table is incredibly reptitive, and could just as easily have been a few lines of logic instead of a lookup if memory was tight (as it was on early boards).

Code: [Select]
static uint8_t PROGMEM matrix122F_to_set3[] = {
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x84, // (), npenter, np3, (), np+, np9, np*, np-
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, // np0, np., np2, np5, np6, np8, numlck, np/
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, //
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
0x00, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, // 0x50 vanishes - is test key.
0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, // 0x48 vanishes - else roll back.
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
0x01, 0x83, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // 0x02 is replaced with 0x83.
};

enjoy
dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline xiphmont

  • Posts: 13
Re: 122-key Unicomp, all scancodes?
« Reply #69 on: Fri, 01 November 2013, 02:59:44 »
Well, the 122 M uses a 20x8 membrane matrix, and the IBM/Lexmark 112 M doesn't use the same matrix as the later Unicomps.  This Unicomp controller at very least can't read the entire original IBM membrane either; eight possible combinations all get mapped to internal offset 0xff (so that there's no way to remap them, even using the EEPROM translation, as it's effectively a bounds error).  I'm also guessing from the some of the weirdness in the mapping that Unicomp modified the membrane a few times; it's like several fixups got layered into the controller, each over the last.  Lots of out-of-order combos get mapped that aren't on the plastic membrane, but then there are the eight possible row/column combinations that don't map at all.

Anyway, a recap of what I've learned to date for certain:

The first 256 bytes are a straight-up positional translation table for remapping keys into new positions.  Each entry is a 16 bit integer in the range 0x00-0x7f.  Higher bits appear to be masked off and completely ignored.

This remapping table is applied before any kind of set translation, and as I mentioned before, it's done according to an internal key position representation that doesn't correspond to any specific scancode set (yes, I mapped it all out, will make a pic with the offsets filled in if folks are interested).

The 256 byte translation table uses the special value 0x52 to trigger a 'macro' sequence.  The controller reads the 32 bit value at 2*offset+0x100 and then uses that to index byte position lookup*2.  At that point it issues the bytes it sees as Set 2 scancodes until it hits 0x00 (the bytes as they appear in in the EEPROM are untranslated Set 2, not matrix positions/etc).  Be careful to get the address right, or you could end up dumping most of the contents of the EEPROM out the PS/2 port which will confuse an X server to no end :-)

The macro setup explains the oddity on these Unicomps where the position hidden under the numlock enter key produces no keypress; in the translation table as shipped, that happens to be position 0x52. With the EEPROM enabled, translation table position 0x52 is the value 0x52.  This triggers a macro sequence, but the jump table lookup finds all zeros as the lookup address, reads position 0x00 in the EEPROM memory, finds the byte 0x00 and issues no scancode.  It seems disabling the EEPROM does not actually stop the translation machinery, it just doesn't read it from the EEPROM, and the 0x52 is still resulting in a map-to-0x00.  It _is_ possible to remap position 0x52 with the EEPROM to produce output.

At a guess, Unicomp needed macros, needed a trigger code in the 0x00-0x7f range and chose a position in the matrix that is never actually exposed on any keyboard model despite existing on the membrane.  On my membrane, no position maps to offset 0x04 either, but perhaps it exists and is exposed on some other model.  Or something.  The whole arrangement honestly feels kind of ad-hoc and half-implemented.

Keys that are simply remapped make/break/repeat and translate into all three sets as expected.  Keys that trigger 'macros' issue the entire sequence of Set 2 scancodes immediately. There is no break, and there appears to be no way to issue a macro on break.  So, for example, you could move the combo ScrollLock/Numlock key and still get make/break/repeat/different scancodes on shift.  You could also use use the EEPROM to set up separate ScrollLock and NumLock, but they would not repeat or send break codes.

Oh, and everything's big endian.
« Last Edit: Fri, 01 November 2013, 03:10:04 by xiphmont »

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
Re: 122-key Unicomp, all scancodes?
« Reply #70 on: Fri, 01 November 2013, 12:36:01 »
Yeah - the matrix kept changing for some reason - extra pad under the keypad enter being a victim in later versions, for example. I put pause there, myself.
  Messing with the Ms is good fun, but eventually I got my hands on an F 122, and then the fun really began. :)

mrr - I have a recent uni with the eprom socketted, wonder how different it is from what you describe. :)
dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline xiphmont

  • Posts: 13
Re: 122-key Unicomp, all scancodes?
« Reply #71 on: Fri, 01 November 2013, 15:44:32 »
Yeah - the matrix kept changing for some reason - extra pad under the keypad enter being a victim in later versions, for example. I put pause there, myself.
  Messing with the Ms is good fun, but eventually I got my hands on an F 122, and then the fun really began. :)

mrr - I have a recent uni with the eprom socketted, wonder how different it is from what you describe. :)
dfj

Well... takes about 15 minutes to make a SI-Prog board that will read it :-)  Assuming you have the parts handy anyway.
I'd be curious to know what's on it.  If you mailed me the EEPROM, I'd dump it.