Sending multiple modifier keys by pressing the butterfly key (shift & ctrl)

Hi,
how can i set the butterfly key as a double modifier key (shift & ctrl)
thx

Use LSHIFT(Key_LeftControl) in place of Key_RightAlt in your firmware sketch. That should do the trick!

Great it works! Very handy to select by word with the arrow keys thx

1 Like

And can we add the shift to function layer also to make it triple would be great

Do you mean that the key should act as Shift + Control and shift to the FUNCTION layer too? In that case, the PrefixLayer plugin could be put to good use, I believe. Unless you want another key that shifts to the layer without having Shift + Control pressed.

If the latter, then a macro could do the trick:

void macroShiftControlLayer(uint8_t keyState) {
  if (keyIsPressed(keyState)) {
    kaleidoscope::hid::pressKey(Key_LeftShift);
    kaleidoscope::hid::pressKey(Key_LeftControl);
  }
  if (keyToggledOn(keyState)) {
    Layer.on(FUNCTION);
  }
  if (keyToggledOff(keyState)) {
    Layer.off(FUNCTION);
  }
}

(Untested, mind you, but something along these lines.)

2 Likes

I mean like you press the 3 keys at the same time. The shift + control + fn

Thx for your quick response

algernon
Gergely Nagy

    February 28

wimstockman:
And can we add the shift to function layer also to make it triple would be great

Do you mean that the key should act as Shift + Control and shift to the FUNCTION layer too? In that case, the PrefixLayer plugin could be put to good use, I believe. Unless you want another key that shifts to the layer without having Shift + Control pressed.

If the latter, then a macro could do the trick:

>   void macroShiftControlLayer(uint8_t keyState) {
> if (keyIsPressed(keyState)) {
> kaleidoscope::hid::pressKey(Key_LeftShift);
> kaleidoscope::hid::pressKey(Key_LeftControl);
> }
> if (keyToggledOn(keyState)) {
> Layer.on(FUNCTION);
> }
> if (keyToggledOff(keyState)) {
> Layer.off(FUNCTION);
> }
> }

hi,

i tried with the TMUX layer and added the keyhook

Key tmuxEventHandlerHook(Key key, byte row, byte col, uint8_t keyState) {
if (keyState & INJECTED)
return key;

if (keyToggledOn(keyState) && key != ShiftToLayer(TMUX) && Layer.isOn(TMUX)) {
handleKeyswitchEvent(LSHIFT(Key_LeftControl), UNKNOWN_KEYSWITCH_LOCATION, IS_PRESSED | INJECTED);
kaleidoscope::hid::sendKeyboardReport();
handleKeyswitchEvent(LSHIFT(Key_LeftControl), UNKNOWN_KEYSWITCH_LOCATION, WAS_PRESSED | INJECTED);
kaleidoscope::hid::sendKeyboardReport();
}

return key;
}

and added
Kaleidoscope.useEventHandlerHook(tmuxEventHandlerHook); in the setup function

the layer works but the hook doesnt… do anything