Is the following possible to do in Chrysalis (gui)?
LShift = LShift
RShift = RShift
LShift + RShift = Ctrl + Shift
I would like this setup so that I don’t have to swap which thumbs are hitting Ctrl and Shift depending on which key I am typing for Ctrl+Shift+key.
algernon
(Gergely Nagy)
2
No, it’s not possible to do this in Chrysalis.
I have something that works independently SpaceCadet:
int shifts_ = 0;
static void ctrlShift(uint8_t keyState, Key key) {
if (keyToggledOn(keyState))
shifts_ += 1;
if (keyToggledOn(keyState) || keyIsPressed(keyState))
kaleidoscope::hid::pressKey((shifts_ >= 2) ? Key_LeftControl : key,
keyToggledOn(keyState));
if (keyToggledOff(keyState)) {
shifts_ -= 1;
kaleidoscope::hid::releaseKey(Key_LeftControl);
}
}
With the following in macroAction
:
case MACRO_CTRL_LSHIFT:
ctrlShift(keyState, Key_LeftShift);
break;
case MACRO_CTRL_RSHIFT:
ctrlShift(keyState, Key_RightShift);
break;
But if I attempt to use SpaceCadet with it, the “tap” key does not appear.
Would you have an idea of how to make the two things work together?
For reference, I got it working with SpaceCadet with the following:
/** ctrlShift presses Ctrl + Shift instead of LShift + RShift
*/
static int shifts_ = 0;
static void ctrlShift(uint8_t keyState, Key shift) {
Key ctrl = Key_LeftControl;
ctrl.flags |= SHIFT_HELD;
if (keyToggledOn(keyState) || keyToggledOff(keyState))
shifts_ += (keyToggledOn(keyState)) ? 1 : -1;
handleKeyswitchEvent((shifts_ >= 2) ? ctrl : shift, UnknownKeyswitchLocation,
keyState);
kaleidoscope::hid::sendKeyboardReport();
}