Can't replace resolveSecondary with ifSecondary -- it's not working

I learned that from firmware v10, resolveSecondary is deprecated. So I tried to follow the advice in reference-manual.md:

please, get rid of this by migrating to ifSecondary advancedStrategy goTo ....

However, this does not seem to work. Here is what I did:

Original macro:

resolveSecondary 200 0 primaryaction secondaryaction

primaryaction:
tapKey backspace
setLedTxt 500 ←
break

secondaryaction:
setLedTxt 0 MAX
holdLayer mod
setLedTxt 1 MAX
break

Rewritten using ifSecondary:

ifSecondary advancedStrategy goTo secondaryaction

primaryaction:
tapKey backspace
setLedTxt 500 ←
break

secondaryaction:
setLedTxt 0 MAX
holdLayer mod
setLedTxt 1 MAX
break

However, when I hold down the corresponding key, it never activates the secondary action. Instead I just get a backspace.

So I then made sure I set up the configuration in $onInit:

set secondaryRole.advanced.timeout 250
set secondaryRole.advanced.timeoutAction secondary
set secondaryRole.advanced.triggerByRelease true
set secondaryRole.advanced.safetyMargin 50

Still does not work. What am I doing wrong? I had to go back to resolveSecondary.

Yep, sorry about it, I messed that code up.

It is already fixed in master, so please wait for next release.

1 Like

Also, with above code you should be getting an error. (Which is a bug and you should not be getting it, but it still is concerning that you are just ignoring thrown errors.)

No, it did not show any ERR. Maybe because I do a lot of SetLedTxt, not sure.

Yes, that will be the reason. Once you overwrite the ERR, it will remain overwritten.

Maybe it would be beneficial if in addition to the text ERR, the triangle led is turned on and stays lit, even if the text is overwritten. I don’t even remember what the triangle was for.

Triangle is for adaptive mode (which is not yet implemented).

I also use it to mark recording of runtime macros, but that is hijacked functionality that will be removed when adaptive mode is implemented.

Regarding led display, we indeed do need to implement something that would take care of the text in an intelligent fashion…

If you don’t have adaptive mode yet, why not use the triangle as an “alarm” icon? When adaptive mode finally arrives, use a constantly lit triangle for adaptive mode and a flashing triangle for error.

Or alternatively, use flashing Agent icon for ERR. Also an indication that user should start Agent, hopefully to get a better error message displayed.

Ah, that explains why I also was not able to change the macro – just did not find the time to report yet. When do you plan the new release? There is no (easy) way to get the current master earlier, is it?

Apart from compiling yourself, no.

I hope Laszlo will manage it in a day or two, he is waiting for some Agent fixes so that both are released…

1 Like

Thanks a lot for your continued work! :smiley:

When we are talking days and not weeks or even months that is great. :keyboard:

1 Like

Meanwhile, we have resolveSecondary:wink:

I agree on commending @kareltucek on his continuous and excellent work. Thanks, Karel!

2 Likes

I have the same issue, but I was strapped for time, and I thought I was missing something to work it out. Thanks @maexxx for share this issue, and thanks @kareltucek for the good work, you’re the best.

1 Like

10.1.0 released now, up on github now.

2 Likes

Can confirm that ifSecondary now works as documented, and I was able to replace resolveSecondary with it.

1 Like

Just released a new Agent and firmware versions, folks. The macro commands should work well with them.

1 Like

Any reported issues with keyclusters on the upgrade? Mine no longer gets detected.

:face_with_raised_eyebrow:

Mine works fine…

Unbricked it and flashed again. All good
Will try my other uhk tomorrow and see what happens.