Skip to content

fix(hid): recognise the MX Keys for Mac's Screen Capture CID (0x00bf) - #1467

Open
4ni1ak wants to merge 1 commit into
AprilNEA:masterfrom
4ni1ak:fix/mx-keys-mac-screen-capture-cid
Open

4ni1ak wants to merge 1 commit into
AprilNEA:masterfrom
4ni1ak:fix/mx-keys-mac-screen-capture-cid

Conversation

@4ni1ak

@4ni1ak 4ni1ak commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • KEYBOARD_KEY_CIDS (crates/openlogi-device/src/session/keyboard.rs) only had 0x010a mapped to ButtonId::KeyScreenCapture — the Signature-series CID. The MX Keys for Mac (046d:b361) reports the same physical function under a different control, 0x00bf (Solaar's Screen_Capture__Print_Screen), so a KeyScreenCapture binding on that keyboard was never diverted — the reporter confirmed via openlogi diag controls that 0x00bf is present and divertable, and via agent logs that no captured control event ever fired for it.
  • Added (0x00bf, ButtonId::KeyScreenCapture) as a second entry. Only one of the two CIDs is ever present on a given keyboard's control table — arm_keys already skips whichever CID the connected device doesn't report ("Missing or non-divertable controls are skipped so support degrades per key") — so both entries coexist safely. This mirrors the same multi-CID-per-ButtonId pattern already used for the gesture button (GESTURE_SOURCE_BUTTONS' 0x00c3/0x00d7/0x00d0).

Changes

  • crates/openlogi-device/src/session/keyboard.rs: added the CID entry, with a comment explaining why the duplicate mapping is safe. Added a unit test asserting both CIDs resolve to KeyScreenCapture.

Testing

  • cargo fmt --all -- --check
  • cargo clippy -p openlogi-device -p openlogi-agent -p openlogi-cli -p openlogi -p openlogi-hid -p openlogi-agent-core -p openlogi-desktop --all-targets -- -D warnings
  • cargo test -p openlogi-device -p openlogi-agent -p openlogi-cli -p openlogi -p openlogi-hid -p openlogi-agent-core -p openlogi-desktop
  • Not runtime-tested on a real MX Keys for Mac — I don't have the hardware. The fix is a direct, minimal application of the CID the reporter's own openlogi diag controls output confirmed, cross-checked against Solaar's special_keys.py reference.

Fixes #1254

KEYBOARD_KEY_CIDS only had 0x010a for ButtonId::KeyScreenCapture — the
Signature-series CID. The MX Keys for Mac (046d:b361) reports the same
function under a different control, 0x00bf (Solaar's
Screen_Capture__Print_Screen), so a KeyScreenCapture binding on that
keyboard was never diverted: the CID it actually needed wasn't in the
table at all.

Added the second (cid, ButtonId) pair alongside the existing one. Only
one of the two is ever present on a given keyboard's control table —
arm_keys already skips whichever CID the connected device doesn't
report — so both entries coexist safely, the same pattern already used
for the gesture button's multiple physical CIDs.

Fixes AprilNEA#1254
@4ni1ak
4ni1ak requested a review from AprilNEA as a code owner September 17, 2026 08:20
@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the additional CID follows the existing diversion model without disrupting the original screen-capture mapping.

Summary

The PR adds the MX Keys for Mac screen-capture CID (0x00bf) as an additional mapping to the existing KeyScreenCapture button and adds a focused unit test covering both recognized CIDs.

  • Preserves the Signature-series 0x010a mapping.
  • Relies on existing CID-keyed diversion logic to skip controls absent from a connected device.
  • Adds regression coverage for the two known screen-capture CIDs.

Reviews (1) · Last reviewed commit: "fix(hid): recognise the MX Keys for Mac'..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MX Keys for Mac (046d:b361): Screen Capture special key cannot be remapped

1 participant