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

**URL:** <https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812>\
**Category:** Plugins\
**Tags:** plugin\
**Created:** [November 30, 2017, 6:36pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812 "2017-11-30T18:36:42Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![florentnicoulaud](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/florentnicoulaud/32/724_2.png) [@florentnicoulaud](https://community.keyboard.io/u/florentnicoulaud)\
**Post date:** [December 13, 2017, 7:57am UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/21 "2017-12-13T07:57:04Z")

</div>

I used the GUI, I’ll do the git clone to get the newest one, thanks.

---

<div class="post-metadata">

**Author:** ![florentnicoulaud](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/florentnicoulaud/32/724_2.png) [@florentnicoulaud](https://community.keyboard.io/u/florentnicoulaud)\
**Post date:** [December 13, 2017, 8:39am UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/22 "2017-12-13T08:39:57Z")

</div>

It’s working fine, thank you for the help.  
And your plugin works like a charm, it’s doing what I’ve been unable to achieve with both SpaceCadet and DualUse !

---

<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:** [December 13, 2017, 1:22pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/23 "2017-12-13T13:22:48Z")

</div>

Fantastic! Thanks for trying it out, and let me know if you have any problems. There are some known compatibility issues (see earlier questions in this thread), but I have a fix for at least one of them in a branch of Kaleidoscope if that becomes a problem for you.

If you feel like sharing, I’m interested in how you’ve configured it, and how fast you type on your Model01.

---

<div class="post-metadata">

**Author:** ![florentnicoulaud](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/florentnicoulaud/32/724_2.png) [@florentnicoulaud](https://community.keyboard.io/u/florentnicoulaud)\
**Post date:** [December 13, 2017, 1:34pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/24 "2017-12-13T13:34:43Z")

</div>

I’m a former Ergodox / Colemak typist, so I’m quite at ease with the model 01.  
I just need to adapt to some new ways / key positions I’m trying out for the occasion of switching from the ergodox to the model 01.  
I discovered the dual use keys, which are very interesting, I’m only using them on the thumb keys to have a shift/enter key under both thumbs.  
What I was unable to achieve with DualUse and SpaceCadet was to be able to do ctrl+enter or alt+enter with my special shift/enter key. I can confirm that I can now do that with your plugin.

I discovered this morning the Community Intros post, I’ll try to introduce myself other there soon.

---

<div class="post-metadata">

**Author:** ![florentnicoulaud](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/florentnicoulaud/32/724_2.png) [@florentnicoulaud](https://community.keyboard.io/u/florentnicoulaud)\
**Post date:** [December 13, 2017, 1:45pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/25 "2017-12-13T13:45:21Z")

</div>

Here’s my (simple) config by the way:

```
  QUKEYS(
    kaleidoscope::Qukey(0, 2, 7, Key_LeftShift), // Enter/shift
    kaleidoscope::Qukey(0, 2, 8, Key_LeftShift) // Enter/shift
  )
```

---

<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:** [January 20, 2018, 5:06am UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/26 "2018-01-20T05:06:13Z")

</div>

I’ve had a [report](https://github.com/gedankenlab/Kaleidoscope-Qukeys/issues/24) of undesired behaviour when releasing two keys (one of which is configured as a `qukey`) simultaneously. I’ve known that if a qukey is pressed, then a subsequent key is pressed, and both are released simultaneously (as far as humans can tell), it will be unpredictable which keycode will be produced by the qukey. When using modifiers, I’m deliberate enough that this is not something that I ever see while interacting normally with a keyboard, but if there is enough call for it, I can add a configurable parameter that will provide a “grace period” for chorded qukey releases. In other words, if a qukey release is detected while at least one other key is pressed, that release (and the decision about which keycode to use) will be deferred until after some short time has passed – say 0-50ms.

This would add a bit of code, and complexity (I’m not really sure how much yet), and it comes with the danger of rollover producing undesired alternate keycodes. It might not be worth the effort, and a second plugin (i.e. SpaceCadet) that does almost the same thing, but defaults to the chorded modifier, might be an easier solution. I’d prefer not to add to the code, but if there’s demand for it, I probably will, so if anyone wants this feature, please comment on it either here or in [Qukeys issue #25](https://github.com/gedankenlab/Kaleidoscope-Qukeys/issues/25).

---

<div class="post-metadata">

**Author:** ![rubas](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@rubas](https://community.keyboard.io/u/rubas)\
**Post date:** [March 3, 2018, 8:44pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/27 "2018-03-03T20:44:13Z")

</div>

> [@merlin](#):
>
> Awesome! I’m so happy someone is using my work! Let me know if you have any problems.

Thank you so much. Being able to map all the modifier in the home row is a game changer 😃 - especially in combination with the [third layer of the NEO layout](http://neo-layout.org/grafik/tastatur3d/tastatur_neo_Ebene3.png).

---

<div class="post-metadata">

**Author:** ![michael](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/michael/32/1038_2.png) [@michael](https://community.keyboard.io/u/michael)\
**Post date:** [March 15, 2018, 8:27pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/28 "2018-03-15T20:27:24Z")

</div>

Thank you, @merlin, for this fantastic plugin! After some initial difficulties the plugin works like a charm. Exactly what I was searching for.

I use the Qukey to switch to a different layer. I made two mistakes in setting that up which I want to share. Maybe it will prevent other people from making the same mistakes or at least help them in figuring out what is happening:

1.) I configured a Qukey on Layer 0 to switch to Layer 1. On Layer 1 that key had a different meaning. That doesn’t work. The key needs in fact to be “transparent” ("\_\_\_") (see mistake 2).

2.) I added a layer which didn’t use the particular key but made it Layer 2 at first. In order to not have the key behave in a different manner I masked it (“XXX”). That got me stuck in Layer 2. The solution was easy: Rearange the new layer to be layer 1 and make the key “transparent” ("\_\_\_")

Here is my very simple configuration:

```auto
  QUKEYS(
    kaleidoscope::Qukey(0, 2, 15, ShiftToLayer(LAYER3LEFT)) // Ä/LAYER3
  )

```

I chose the name “LAYER3LEFT” because it switches to layer3 of the NEO layout but omits the ‘@’ sign which happens to be on the same key as the Qukey. See @rubas post.

---

<div class="post-metadata">

**Author:** ![michael](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/michael/32/1038_2.png) [@michael](https://community.keyboard.io/u/michael)\
**Post date:** [March 19, 2018, 6:53pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/29 "2018-03-19T18:53:10Z")

</div>

Hi @merlin,

today I realized that the qukeys work like a charm but I’m unable to type shifted characters. That affects both keys that I’m using with the qukeys plugin. Did anyone else experience something similar. Any idea what might be the issue?

---

<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:** [March 19, 2018, 7:51pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/30 "2018-03-19T19:51:24Z")

</div>

I’m not sure what you mean by “shifted characters”. Can you be more specific?

---

<div class="post-metadata">

**Author:** ![michael](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/michael/32/1038_2.png) [@michael](https://community.keyboard.io/u/michael)\
**Post date:** [March 19, 2018, 7:53pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/31 "2018-03-19T19:53:28Z")

</div>

Sorry. I mean uppercase letters. I have ‘y’ and ‘ä’ as qukeys (which are ‘z’ and ‘’’ printed on the caps) and I can only produce lowercase letters.

I also realized, that when pressing Shift, my qukeys will not work their alternate function any more.

---

<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:** [March 19, 2018, 7:56pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/32 "2018-03-19T19:56:16Z")

</div>

If you send me a link to your sketch, I can probably figure out what’s going on.

---

<div class="post-metadata">

**Author:** ![michael](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/michael/32/1038_2.png) [@michael](https://community.keyboard.io/u/michael)\
**Post date:** [March 19, 2018, 8:01pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/33 "2018-03-19T20:01:27Z")

</div>

I just found it: It seems to be an incompatibility with the OneShot plugin. I configured my Shift-Key to be a OneShot-Key. If I change it back into a “normal” Shift Key I can type uppercase-letters again.

I’ll check if I can workaround that by modifying the order of the plugins.

---

<div class="post-metadata">

**Author:** ![michael](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/michael/32/1038_2.png) [@michael](https://community.keyboard.io/u/michael)\
**Post date:** [March 19, 2018, 8:03pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/34 "2018-03-19T20:03:56Z")

</div>

Sadly the order of plugins doesn’t make a difference.

---

<div class="post-metadata">

**Author:** ![michael](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/michael/32/1038_2.png) [@michael](https://community.keyboard.io/u/michael)\
**Post date:** [March 19, 2018, 9:33pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/35 "2018-03-19T21:33:09Z")

</div>

After reading the code for a while I think I understand what is happening:

The Qukeys plugin directly sends out keyboard-reports therefore bypassing all other plugins on the way.

In order for other plugins to be able to work, the Qukeys-queue would have to be flushed in a different manner.

This is not fully thought through but I imagine the plugin would have to add the keys back to the scan-matrix so that other plugins would be able to see the key, while remembering that this particular key was just released from the queue so it doesn’t register in the Qukeys-plugin again.

---

<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:** [March 19, 2018, 11:08pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/36 "2018-03-19T23:08:02Z")

</div>

When Qukeys sends a report mid-scan, it directly copies the previous keyboard HID report, so if any modifiers were active in the previous report, they still should be when the Qukeys report gets sent. If your explanation is correct, unless I’m wrong about how OneShot works, it’s not a design flaw, but it is a bug in one or the other of the plugins.

---

<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:** [March 19, 2018, 11:15pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/37 "2018-03-19T23:15:21Z")

</div>

Furthermore, it doesn’t bypass the other plugins, it calls `handleKeyswitchEvent()`… which is maybe why OneShot isn’t working for you. What keys do you have defined, and in what order do you press and release them in order to produce the unintended behaviour?

---

<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:** [March 20, 2018, 4:14am UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/38 "2018-03-20T04:14:24Z")

</div>

I think I’ve figured this out. I’ll have a PR ready shortly for you to test, @michael. I admit that I don’t really understand the code for Kaleidoscope-OneShot, but it seems to be a problem of OneShot sending injected events with `UNKNOWN_KEYSWITCH_LOCATION` that Qukeys wasn’t ignoring.

---

<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:** [March 20, 2018, 4:32am UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/39 "2018-03-20T04:32:13Z")

</div>

The PR is ready – it’s [Qukeys#36](https://github.com/gedankenlab/Kaleidoscope-Qukeys/pull/36), if you want to give it a try. I was able to reproduce what I think is the bug you were seeing, and this change fixes it for me.

---

<div class="post-metadata">

**Author:** ![michael](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/michael/32/1038_2.png) [@michael](https://community.keyboard.io/u/michael)\
**Post date:** [March 20, 2018, 2:34pm UTC](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812/40 "2018-03-20T14:34:43Z")

</div>

Lovely. That works. Thank you for your continuous efforts!

Just out of curiosity: Why are you using a pull request on your own repository?

[Previous page](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812.md?page=1)

[Next page](https://community.keyboard.io/t/new-plugin-qukeys-yet-another-spacecadet-dualuse-type-plugin/812.md?page=3)
