# Possible to configure Shift+LeftGui to input Alt+F2?

**URL:** <https://community.keyboard.io/t/possible-to-configure-shift-leftgui-to-input-alt-f2/1621>\
**Category:** Help and Getting Started\
**Created:** [June 12, 2018, 1:24pm UTC](https://community.keyboard.io/t/possible-to-configure-shift-leftgui-to-input-alt-f2/1621 "2018-06-12T13:24:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamadagni](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jamadagni/32/2030_2.png) [@jamadagni](https://community.keyboard.io/u/jamadagni)\
**Post date:** [June 12, 2018, 1:24pm UTC](https://community.keyboard.io/t/possible-to-configure-shift-leftgui-to-input-alt-f2/1621/1 "2018-06-12T13:24:39Z")

</div>

I understand that I can configure different layers where one layer contains LeftGui on a key and another contains Alt+F2. But is it possible to configure Shift+LeftGui to input Alt+F2?

It doesn’t seem sane to configure Shift for such layer change behaviour. So is this really hare-brained/impossible/not worth it?

---

<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:** [June 12, 2018, 1:55pm UTC](https://community.keyboard.io/t/possible-to-configure-shift-leftgui-to-input-alt-f2/1621/2 "2018-06-12T13:55:01Z")

</div>

```auto
namespace kaleidoscope {
class SLAltF2 : public kaleidoscope::Plugin {
 public:
  SLAltF2() {}

  EventHandlerResult onKeyswitchEvent(Key &mappedKey, byte row, byte col, 
                                      uint8_t keyState) {
    if (mappedKey == Key_LeftGUI && hid::wasModifierKeyPressed(Key_LeftShift)) {
      hid::releaseKey(Key_LeftShift);
      mappedKey = LALT(Key_F2);
    }
    return EventHandlerResult::OK;
  }
}
}

```

Something along these lines. The idea is that whenever a key is pressed, we check if that is the GUI key, then check is `Shift` was pressed previously, and if so, release shift, and change the current key. Otherwise leave everything as-is.

This only works when you press `Shift` first, but can be adapted to work in case `Gui` goes down first, too. Adding support for right shift is left as an exercise for the reader. 🙂

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [June 12, 2018, 3:01pm UTC](https://community.keyboard.io/t/possible-to-configure-shift-leftgui-to-input-alt-f2/1621/3 "2018-06-12T15:01:00Z")

</div>

This won’t work if your intention is to use those two left-side thumb keys with the same finger on the default layout, but here’s another option that might also work for you:

You could use Qukeys to configure any of your modifier keys to be `F2` when tapped, and use your regular `alt` key normally to modify it. For example, you could replace `Key_LeftGui` with `GUI_T(F2)` in your keymap. Then holding alt and tapping cmd would result in `alt`+`F2`.

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [June 12, 2018, 3:05pm UTC](https://community.keyboard.io/t/possible-to-configure-shift-leftgui-to-input-alt-f2/1621/4 "2018-06-12T15:05:44Z")

</div>

[Note: Qukeys is a lot of code. If you just want this one thing, it may be less work to implement it with the existing plugin, but @algernon’s solution has a much, much smaller footprint on the MCU, so if your sketch is already pushing the boundaries of the chip’s memory, a miniature custom plugin is the way to go.]
