ahtn / keyplus

An easy to use, wired and wireless modular keyboard firmware
MIT License
246 stars 40 forks source link

Last key in some layouts activates unwanted modifiers. #77

Closed ahtn closed 5 years ago

ahtn commented 6 years ago

Sometimes the last key in a layout will trigger all the modifier keys in addition to the key pressed. This is probably caused by an off by one error triggering a keycode outside the layout.

Related to issue mention in #60 with this layout:

     matrix_map: [
        r0c0, r0c1,
        r1c0, r1c1,
        r2c0, r2c1,
        r3c0, r3c1,
      ]

layouts:
  launchpad:
    layers: [
      [ # Layer 0
        [ # Launchpad (device 0)
          F13, F14,
          F15, F16,
          MENU, AUDIO_MUTE,
          AUDIO_VOL_DOWN, AUDIO_VOL_UP,
        ]
      ]
    ]

Pressing AUDIO_VOL_UP results in ctrl-alt-super-shift-AUDIO_VOL_UP being pressed.

Also reproduce in this layout:

    scan_mode:
      mode: col_row
      rows: [P2.0, P2.1, P1.7, P1.6]
      cols: [P0.2, P0.3, P0.4, P0.5, P0.6, P0.7]

      matrix_map: [
        r0c0, r0c1, r0c2, r0c3, r0c4, r0c5,
        r1c0, r1c1, r1c2, r1c3, r1c4, r1c5,
        r2c0, r2c1, r2c2, r2c3, r2c4, r2c5,
        r3c0, r3c1, r3c2, r3c3, r3c4, r3c5,
      ]
    layout: 4x6

layouts:
  4x6:
    layers: [
      [ # layer 0 (base)
        [
          0, a, b, c, d, e,
          1, f, g, h, i, j,
          2, l, k, m, n, o,
          3, p, q, r, s, t
        ]
      ],
    ]

where pressing t results in rctrl + rshift + rsuper + ralt + t

ahtn commented 5 years ago

Off by one error, fixed in e9880d5f883238eac09faed7bf0fe2dc12d86553. relevant line