I have two main layers: PRIMARY, and FUNCTION. Sine I rarely use LeftGui, it is in FUNCTION. That it, to press LeftGui, I have to hold the switch key, and press some other key. The problem is, my FUNCTION layout overrides most keys of my keyboard, so if I try to press LeftGui+E, for instance, it will actually press LeftGui+(E in FUNCTION layout).
I managed to fix this by instead having a macro that 1. deactivates the FUNCTION layer, and 2. sends a raw LeftGui key press, but unfortunately I hit another problem: LeftGui is immediately released.
Here’s the code of the macro (with M(MACRO_TO_GUI) in the FUNCTION layer):
case MACRO_TO_GUI:
if (keyToggledOn(keyState)) {
Layer.deactivate(FUNCTION);
kaleidoscope::hid::pressRawKey(Key_LeftGui);
kaleidoscope::hid::sendKeyboardReport();
return MACRO_NONE;
} else if (keyToggledOff(keyState)) {
Layer.activate(FUNCTION);
kaleidoscope::hid::releaseRawKey(Key_LeftGui);
kaleidoscope::hid::sendKeyboardReport();
return MACRO_NONE;
}
break;
Any idea how to achieve this?