New plugin: Qukeys (yet another SpaceCadet/DualUse-type plugin)

I’d just been banging on about using OneShot and Qukeys in this post Top 5 plugins or macros? and thought it not unreasonable to make a link to it from here, but also to share the details of my own successful Qukeys/OneShot use.

I configure the home row keys (both sides) to be Qukeys thus:

  QUKEYS(
    kaleidoscope::Qukey(0, 2, 1,  Key_LeftGui),
    kaleidoscope::Qukey(0, 2, 2,  Key_LeftAlt),
    kaleidoscope::Qukey(0, 2, 3,  OSM(LeftShift)),
    kaleidoscope::Qukey(0, 2, 4,  Key_LeftControl),
    kaleidoscope::Qukey(0, 2, 11, Key_LeftControl),
    kaleidoscope::Qukey(0, 2, 12, OSM(LeftShift)),
    kaleidoscope::Qukey(0, 2, 13, Key_LeftAlt),
    kaleidoscope::Qukey(0, 2, 14, Key_LeftGui)
  )

But you’ll see I also set the d and k keys (QWERTY) to be OneShot modifiers - LeftShift, to be precise.

The aim was a common one; fast typing but keeping movement from the home rows at a minimum. Prior to getting my Keyboardio I’d always used Sticky Keys set at OS level, and I thought this would be something that I’d always use, but by having all the modifiers on the home row, chording is no longer the strain it once was and I quickly realized that I could dispense with Sticky Keys (which, despite the huge benefits, also came with a fair few annoyances). The Shift key is different though just by virtue of the sheer frequency of its use. Typing slowly, it’s no problem to press and hold k (bound to the alternate Qukey of LeftShift), tap e, and then release k, in order to type an ‘E’, say, but this really slows you down and feels very ‘clunky’ when trying to type faster. So this is where OneShot comes back in in all its glory as a more configurable version of Sticky Keys.

Timings are important here: typing at normal speed you want all the keys to give only their primary keycodes. Holding any of the home row keys will give their alternate keycodes. But then you want something in between the tap and the hold to give you the OneShot modifier lurking underneath the Qukey. I’ll call this between-hold-and-tap duration the ‘long-tap’, because it should be ideally closer to a tap than a hold.

So, your mileage would definitely vary, but for me, this works very nicely:

Qukeys.setTimeout(150);
OneShot.time_out = 300;
OneShot.hold_time_out = 500;
OneShot.double_tap_sticky = false;

The default setting for Qukeys.setTimeout is 250 ms, so I’ve lowered that a little but without problem. The reason I lowered it is because I want the d and k keys to descend into their underlying OneShot nature as quickly as possible but without affecting the use of the other Qukey home row modifier keys should I tap another key before releasing one of these Qukeys (which could have non-amusing consequences).

The OneShot.time_out = 300; setting is very different from the default setting of 2500 ms, but this is absolutely what I want for normal typing. When one of these OneShot shift key modifiers is in operation I only want it to remain sticky for however long it takes me to go from releasing said OneShot/Qukey and pressing the next key, which would typically yield the desired capital letter or symbol. I expect for many this timeout could kick in even sooner.

The OneShot.hold_time_out = 500; setting is also different from the default 200 ms. I’m not entirely certain whether this matters when used in conjunction with a Qukey. I set it quite high, but I don’t doubt that if I’m key-chording my way outta somewhere with a Ctrl-Shift-q, I still end up outta wherever despite holding the Shift for longer than half a second. In any case, the main point would be that if I ever press the d or k key for anything longer than a tap I want a Shift whether it times out after 200 ms (after a long-tap), or times out immediately after release (for a ‘hold’).

I set OneShot.double_tap_sticky = false; as I imagine it would be tricky getting this to work appreciably well, but the truth is I’m not even brave enough to try!

Anyway, in summary for a OneShot/Qukey Shift modifier, what I’ve found to work harmoniously:

  • for ‘key down’ duration < 150 ms : you get the primary keycode
  • for ‘key down’ duration > 150 ms : you get the alternate keycode

Upon release of such a key:

  • after < 300 ms : the Shift modifier is ‘sticky’.
  • after > 300 ms : the Shift modifier times out and subsequent key-presses will be unmodified.
3 Likes