Help learning new layouts

I moved my numbers to the home row. I’ve been thinking of changing the original number keys to put out Marcos that print number x is on the home row under ?. I think this could help facilitate movements of keys for short term. I could use tap dance to add more than one action under the other keys if I still need them. Is there a way to add arguments to macros?

If you use different numbers to identify the macros, it should be easy enough to do something like that…

enum { M_1, M_2, M_3, .... };

void printWarningMessage(uint8_t number) {
   // type "<number> is on the home row"
}

const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
    switch (macroIndex) {
     case M_1:
     case M_2:
     ....
     case M_0:
       printWarningMessage(macroIndex);
       break;
   }
}

// In the keymap,

   M(M_1), M(M_2), ....

So no direct way to pass in arguments. Oh well, I will use this method then.

Another thing you may consider (either instead or in addition to printing text) is to flash the wrong key in red, and the good one in green. A kind of visual cue for locating the correct key easier.

2 Likes

I like the use of flashing the keys. Would you suggest using a macro to do the flashing or is there some better way? What is the best way to do the timing on the flash. Is there a timing that can be passed into an led effect or do I need to macros? One when I press the wrong key to change the colors and then one when I press the right key to change them back to my default theme?

I think macros are the most straightforward here. You can do it with macros for the wrong keys only, at the cost of the flash persisting through its timeout, even if you press the right key before that.

You can do this because macro actions will be called even when there are no events on the key, in every scan cycle. This is precisely this way to allow implementing functionality that runs when the key is idle - such as timing out some animation!

This example is somewhat similar, at least in spirit. Instead of setting all LEDs, you’d only set two: the wrong one and the bad one, and instead of setting all to black, you’d call LEDControl.refreshAt() for both keys, to reset them to whatever color the LED mode set them to. (And obviously, the layer changing code would be exchanged for the printing stuff.)

Hope this helps!

I’m having an issue with the helper lights staying on. If someone would like to take a look I’dl love some help.

Gave you an inline comment, that should help a little (or so I hope). Let me know how it goes!

Thanks, for the help. I got it to work, but I don’t quite understand. I commented back. I also pushed the change to them master branch if you want to see what I did. I welcome any suggestions on what is a better way.

2 Likes