Skip to content

271. Device mode's keypad map is the device's own mode record, and section 151 looked in the wrong slot

This closes the open question section 151 left and refutes the claim it left standing. That section measured base slot 9, found that every keypad map sending an infrared code is installed by an activity, and concluded that no configuration here holds a keypad map for device mode. The conclusion followed correctly from the measurement and the measurement was of the wrong structure. A device's own map is a base slot 6 mode record's own tagged list, the one section 52 reads through the back pointer beside the entry, and the firmware consults it on every key press.

So the third of section 151's three readings is the right one, "a map in the container nobody here recognises", and it was recognised: the reader for it, taggedList over modeRecords(c)[m].start, has been in packages/codec since section 52. Nothing had asked it what the lists send.

What was checked before the work started

docs/findings.md sections 37, 39, 52, 66, 67, 68, 69, 120 and 151; docs/config-format.md base slots 6 and 9; the Harmony 700 2.8 and Harmony One 3.4 images; and docs/myharmony/model.md, which is Logitech's own schema as it was mined on 30 August 2026. The last of those is the reason to have looked again at all: their platform declares DeviceButtonMap keyed by a DeviceId beside ActivityButtonMap keyed by an ActivityId, so the vendor states that a device's map is a first class object, and this project's own specification said no such object is in the file.

The firmware resolves a key against the page, then the mode, then the base slot 9 stack

Section 69 read the two block routine at 0x168F4 on the Harmony 700 and named its two pointers: the u24 at page record + 0, which is the page's list, and the u24 at entry + 1, which is the back pointer to the mode record's own list. What that section did not ask is where the tag comes from, and the tag is what makes the second block a keypad map rather than a lifecycle hook.

0EAC0:  MOVF 0x03,W ; XORLW 0xfc ...     a switch on the stack entry's kind
0EAD0:  MOVFF 0x1b0,gprF2F               the key event, into the tag
        CALL 0x168f4                     page's list, then the mode record's own
        BZ ...                           a miss falls through to the next entry
0EAE0:  MOVFF 0x1b0,0x3c4                the same key event
        MOVFF 0x120,0x3c3                a base slot 9 list instead
        CALL 0x1b6de

0x1B0 holds the key event, an event type in 0xC0 and a scan code in 0x3F. The XORLW chain decodes to three cases, 0xFC, 0xFE and 0xFD, with a default: one of them is the current mode and its page and the other three are base slot 9 lists from three different sources. So the screen's mode is an entry on the same key resolution stack the base slot 9 sets sit on, and inside that entry the page overrides the mode.

The Harmony One 3.4 image is the same shape at a different address. 0x24D98 puts the key event from 0xEB2 into 0x229 and calls 0x283F6, which reaches the two consecutive blocks at 0x28430 and 0x2846C, both calling the runner at 0x2E2F2; the chain's other arms pass the same key event to 0x326 and call 0x2E2B4, which is base slot 9's. Two architectures, no third mechanism.

Every device in the corpus has one, and it sends only that device

For each infrared group, take the modes whose own tagged list runs a list that sends that group, and pick the one whose keypad and screen maps are largest together.

count
device groups with at least one infrared code 62
such a mode exists 62
the largest is unique, with no tie 62
it sends only that device, on its keypad and on its pages alike 62

Over the fifteen user configurations on four architectures. The one device group with no map is the Harmony 600 configuration's third, which has zero infrared codes, so no map could send anything for it: the exclusion is the population's rather than the reader's.

The purity is the result worth keeping, because it is Logitech's own sentence measured. The Harmony One manual says "after you select a device, the Harmony One controls only that device", and here 62 of 62 maps address one device and no other, where an activity's map mixes two or three routinely.

The independent closure: the drawn device list names the same mode

On arch 12 (Harmony One) the device list is drawn on the screen and each row's action list enters a mode, which deviceListRows has read since section 239 by an entirely separate route: the row's own 0x7E, decoded from the screen, with no reference to infrared groups at all. The census above starts from the infrared groups and never looks at the device list.

They agree on 8 of 8, across four containers: one_config's five devices, and the single device of one_config_unprogrammed, one_spare_before_sync and one_spare_after_sync, the last of which moved from mode 44 to mode 98 between the two reads of the same remote and is matched at both.

The calibration case: the factory configuration

one_config_unprogrammed holds one device and one activity, so the two maps can be compared with nothing else in the way. The device's mode binds 30 keypad keys and 50 screen keys over 9 pages; the activity's base slot 9 set binds 24 keys that send a code, and all 24 hold the same command as the device's map, with none differing and none missing. The device map carries 6 keys the activity does not.

The keypad and the screen are disjoint populations, in all fifteen

A mode record's own tagged list binds physical keys and its pages bind screen keys, and the two scan code populations do not intersect anywhere in the corpus: 0 shared scan codes in each of the fifteen user configurations, on all four architectures. That is section 128's disjointness seen from a third side, and it is what makes the split between the two halves structural rather than a convention.

The two halves are comparable in size and which is larger varies per configuration. Over the 62 maps, 1609 keypad bindings against 1818 screen bindings. That corpus total must not be read as "the screen is the bigger half", which is how it was first written up: per configuration the screen half is larger in 8 and the keypad half in 7, and on the programmed Harmony One the keypad half is nearly twice the size, 157 against 81. Per device the keypad runs from 1 to 38 bindings and the screen from 1 to 109.

Nothing here explains the variation, and one explanation was offered and withdrawn the same afternoon: that a screen budget is shared out, since a configuration driving one device gives it 50 to 81 screen buttons and one driving five gives each about 16. It is not monotone. Mean screen buttons per device against the number of devices the configuration drives: 61, 33, 21, 16, 28, 30 for one, three, four, five, six and seven devices. The story fitted the first four points and the corpus had the other two.

Section 151 argued from the product side that an old remote has more buttons than a Harmony and the overflow goes on the screen. That argument is about what people build and is untouched by these counts; what these counts refute is only the byte level restatement of it.

The consequence: a reconstructed device map is wrong, and section 151's own nine reappear

Section 151 said an activity's map reads as the device's map plus that activity's overrides, and that this makes a device map reconstructable where the file states none. The file does state one, so the reconstruction can be scored against it. Every pair of a device and a key that some activity map binds, against the same device's stated map:

count
pairs of a device and a key bound by an activity 1123
the stated map holds the same command 896
the activities agree with each other and the stated map differs 136
the activities disagree among themselves 9
the stated map does not bind that key at all 82
keys the stated map binds that no activity binds 568

The nine are section 151's nine, arrived at over a population counted differently, which is what says the two measurements are of the same thing.

Two readings, and the second is the one with teeth. The reconstruction is wrong on 136 of the 1032 pairs where every activity agrees, which is 13%, so "where the activities agree, that is the device's answer" is not a rule. And it is blind to 568 keys, a third again as many as it sees, so a device page built from the activity maps shows two thirds of the device. FreeHarmony reads the stated map.

What the 136 are is not established here. They are what an activity overrides, on the straightforward reading, which would mean section 151 undercounted overrides by an order of magnitude because it could only see the ones activities disagreed about. Nothing in this section tests that.

What would falsify it

A device group whose largest single-group mode is shared with another group's codes; a user configuration where a device with codes has no such mode; a firmware where the second block of the two block lookup is reached with anything but a key event in the tag; or a Harmony One whose device list row enters a mode the census does not pick.

Where it lands

  • docs/config-format.md, base slot 6 and base slot 9, both of which stated the dead claim.
  • packages/codec/src/inventory.ts: deviceModeMaps, with DeviceModeMap.
  • packages/codec/test/inventory.test.ts: every count above, and the negative that carries the claim, that a device mode map addresses exactly one device.
  • Section 151 is corrected in place and the dead wording is in reference/superseded.md.

Section 270 | the archive | section 272. Section 271 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.