Ctrl + scroll for zoom not working from keyboard but working from mouse

The LCTRL() macro only works for traditional keyboard keys. The reason for this is purely technical: we have keycodes on the keymap, which the firmware interprets. There’s only so much bits (16) per key, to describe what it does, and if we wanted to support LCTRL with mouse keys, we wouldn’t fit into 16 bits.

To achieve what you want, you can use a macro, like the following:

const macro_t *ctrlScroll(uint8_t keyState, uint8_t macroIndex) {
  Key direction = Key_mouseScrollDn;
  if (macroIndex == M_CTRL_SCROLLUP)
    direction = Key_mouseScrollUp;

  handleKeyswitchEvent(Key_LeftControl, Macros.row, Macros.col, keyState);
  handleKeyswitchEvent(direction, Macros.row, Macros.col, keyState);

  return MACRO_NONE;
}

…or something along these lines. I haven’t tested the above code, so it may be a little buggy. If it is, let me know, and I’ll help fixing it up.

2 Likes