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

**URL:** <https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148>\
**Category:** Help and Getting Started\
**Created:** [February 28, 2018, 12:01pm UTC](https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148 "2018-02-28T12:01:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wimstockman](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/wimstockman/32/3183_2.png) [@wimstockman](https://community.keyboard.io/u/wimstockman)\
**Post date:** [February 28, 2018, 12:01pm UTC](https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148/1 "2018-02-28T12:01:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [February 28, 2018, 12:05pm UTC](https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148/2 "2018-02-28T12:05:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wimstockman](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/wimstockman/32/3183_2.png) [@wimstockman](https://community.keyboard.io/u/wimstockman)\
**Post date:** [February 28, 2018, 1:44pm UTC](https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148/3 "2018-02-28T13:44:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wimstockman](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/wimstockman/32/3183_2.png) [@wimstockman](https://community.keyboard.io/u/wimstockman)\
**Post date:** [February 28, 2018, 2:13pm UTC](https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148/4 "2018-02-28T14:13:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [February 28, 2018, 2:44pm UTC](https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148/5 "2018-02-28T14:44:01Z")

</div>

> [@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](https://github.com/jamesnvc/Kaleidoscope-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:

```c++
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.)

---

<div class="post-metadata">

**Author:** ![wimstockman](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/wimstockman/32/3183_2.png) [@wimstockman](https://community.keyboard.io/u/wimstockman)\
**Post date:** [February 28, 2018, 3:16pm UTC](https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148/6 "2018-02-28T15:16:18Z")

</div>

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

Thx for your quick response

> ![](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/45/10_1.png "algernon")
> 
> [algernon](https://community.keyboard.io/u/algernon)  
> [Gergely Nagy](https://community.keyboard.io/u/algernon)
> 
> ```
> February 28
> 
> ```
> 
> > ![](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/wimstockman/40/958_1.png) 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](https://github.com/jamesnvc/Kaleidoscope-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:

```auto
> 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);
> }
> }

```

---

<div class="post-metadata">

**Author:** ![wimstockman](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/wimstockman/32/3183_2.png) [@wimstockman](https://community.keyboard.io/u/wimstockman)\
**Post date:** [February 28, 2018, 11:26pm UTC](https://community.keyboard.io/t/sending-multiple-modifier-keys-by-pressing-the-butterfly-key-shift-ctrl/1148/7 "2018-02-28T23:26:24Z")

</div>

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
