BlueMicro_BLE icon indicating copy to clipboard operation
BlueMicro_BLE copied to clipboard

Modified keycodes work inconsistently on Chrome OS (and Linux?)

Open bcat opened this issue 5 years ago • 1 comments

Describe the bug Modified keycodes (such as the shifted keycodes) work fine on Windows, but generally don't work on Chrome OS. (Given that Chrome OS runs Linux under the hood, I suspect Linux suffers from the same issue, but I don't have a Linux system at hand to check.)

I think the issue is that BlueMicro firmware sends two reports for a modified keycode:

  • Report 1: modifier down, base key down
  • Report 2: modifier up, base key up

Whereas QMK seems to send four reports:

  • Report 1: modifier down, base key up
  • Report 2: modifier down, base key down
  • Report 3: modifier down, base key up
  • Report 4: modifier up, base key up

To support this theory, if you press multiple keys mapped to modified keycodes at the same time, Chrome OS does interpret most of them as modified. This makes me think Chrome OS (and probably Linux) get confused if the modifier and the base key don't go down/up in separate key reports.

QMK has a "weak mods" mechanism that it uses to implement modified keycodes, but I'm not sure if BlueMicro needs anything that advanced. I think all we need is a way to force extra key reports between modifier and base key (un)register.

To Reproduce Steps to reproduce the behavior:

  1. Flash a BlueMicro keyboard using modified keycodes (e.g., the shifted keycodes often used on the top row of 40% keyboards).
  2. Pair with Chrome OS (or Linux?).
  3. Press the keys in question.
  4. Observe that the keys are interpreted as unmodified.

Expected behavior Modified keys work on all platforms.

bcat avatar Oct 12 '20 15:10 bcat

Although in practice, if we spread these keys across more reports, there may be race conditions if we don't introduce a mechanism like weak mods, which are cleared if a different key is pressed.

bcat avatar Oct 12 '20 15:10 bcat