ActiveModColor and OneShot with multiple keys locking the same layer?

I am trying to use both the LED key and the Any key as OneShot keys to enable a layer unfortunately also called ANY:

  (XXX,          Key_1, Key_2, Key_3, Key_4, Key_5, OSL(ANY),
   OSL(ANY),  Key_6, Key_7, Key_8,     Key_9,         Key_0,         Key_Backslash,

I have ActiveModColor enabled.

  // oneshot test
  // activemode


void setup() {
  // Oneshot, reduce delay.  default is 2500ms
  OneShot.time_out = 1250;
  // activemod test
  ActiveModColorEffect.highlight_color = CRGB(0x00, 0xff, 0xff);

If I just have the Any key mapped to OSL(ANY), this works fine.
If I have both Any and LED mapped to OSL(ANY), I only get partial OneShot behavior on the LED key.

  • the Any key works fine: single click turns the Any key white and sets up OneShot to layer ANY, and double click turns it red and locks it ther.

  • if I single click the LED key, the Any key turns white and the layer is activated. I was expecting the LED key to turn white, but turning Any white instead is fine.

  • if I double click the LED key, I get no OneShot behavior at all. There’s no stickiness, it just turns the Any key white and then resets it again.

I’m doing this because I want to use macros in the ANY layer bound to the number keys, and I would like to sometimes activate them with one hand. So LED+1, for example, should work the same as Any+1. This works fine for ShiftToLayer(), which is my fallback, but I was hoping to get OneShot working.

Is this broken? Have I missed a mandatory config knob somewhere?


What are those two keys mapped to on the ANY layer? I’m guessing the led key is mapped to a non-transparent value on that layer.

Incidentally, there’s a Kaleidoscope change awaiting review that should improve ActiveModColor, and another for OneShot. If you’d like to test out those changes, I can send you a link to the source.

I have an idea for a change that could keep OneShot layer keys available for double-tapping to make them sticky even if there’s another key mapped to that position on the target layer, but that’s a more fundamental change to Kaleidoscope that isn’t likely to happen quickly.

1 Like

You’re right, the LED key on the Any layer was mapped to Key_CapsLock. I tried remapping it to ___ and to XXX and saw no change in behavior. Single-tapping LED turns on the Any key, and double-tapping does nothing.

Happy to try out diffs or other experiments.

If you share your sketch, I can probably find the problem. If you use Chrysalis to configure your keymap, I might have more trouble.

Do you just need KEYMAPS(), or the whole sketch? I have some macros with sensitive contents and would have to clean up the sketch before posting it.

The things that matter are the KEYMAPS() definition, the order of plugins in KALEIDOSCOPE_INIT_PLUGINS(), and the configuration statements in the definition of the setup() function. It’s possible that something else is causing the problem, but not very likely.

I submitted an issue to your dummy repository with the solution that works for me. Basically, one of the OneShot keys was mapped to XXX on the target layer instead of ___.

1 Like