likern
November 30, 2023, 11:43am
1
Hello! Could anyone help showing how can I achieve this
ifDoubletap {
ifLayer base {
toggleLayer shift
final setLedTxt 0 "SHF"
}
ifLayer shift {
toggleLayer base
final setLedTxt 0 "BAS"
}
} else {
oneShot holdKey RS-
}
So what I want to get…
If I press key once it works as shift waiting until I press another key. As soon as I press another key shift is deactivated.
If I double tap key it works as prolonged shift , like I hold shift indefinitely . Thus I can type SOMELONGTEXT easily.
If I in mode 2 - double tap key returns me back to usual mode (shift is not hold). Double tap - for consistency.
If I’m correct there is no problems with these interactions, at least I can’t see.
likern
November 30, 2023, 12:09pm
2
And I think relevant question
How to allow to switch led text with seLedTxt only for the duration of oneshot command
Whenever oneshot command finished executing led text should automatically return back to it’s original value.
Well, is there any problem with the code above?
Else needs to be on a new line. Apart from that it looks like it should work.
How to allow to switch led text with seLedTxt only for the duration of oneshot command
setLedTxt 0 "<your text>"
oneShot holdKey RS-
setLedTxt 1 " "
likern
November 30, 2023, 4:51pm
4
It worked, but there was one problem. If I double tap, not only I get layer switch, but also as if I additionally pressed shift one more time.
What do you mean by “additionally pressed shift one more time”?
ifDoubletap only triggers on the second tap, so the first tap will trigger the else clause.
If you want the macro to query for future strokes, you will need to replace ifDoubletap
by ifGesture $thisKeyId
. E.g.:
ifGesture $thisKeyId {
ifLayer base {
toggleLayer shift
final setLedTxt 0 "SHF"
}
ifLayer shift {
toggleLayer base
final setLedTxt 0 "BAS"
}
}
else {
oneShot holdKey RS-
}
1 Like
Not sure if the last answer worked, but I’ve been doing this for ages using this macro. It’s not as cool as the spiffy code lol, but it does exactly what you describe you want to do:
maexxx
February 21, 2024, 8:35am
7
Btw, @UHQueefboard , you can write both commands into a single </> Command
entry box. Is there a reason why you kept them separate?
Legacy from my initial learning lol
Followed by adherence to the principle of “if it’s working, don’t touch it”
But yeah I should go thru and condense all the commands I have split.
I’ve updated to the latest firmware and have not had an instance of the issue occurring as yet. Would have normally had a few by now, so fingers crossed!!!
Thanks again for all the help & work on this one, much appreciated.
It’s been over a full day now with no errors - woot!!!