Closed antler5 closed 6 months ago
Aside: I initially believed that enabling visible-backspaced consistently caused LSFT to be left Down, as I observed that behavior and had to escape out of it with lctl+spc+esc even after resetting to master. I realized while writing the report that it made sense, because when visible-backspaced isn't enabled LSFT probably gets eaten anyways, so of course it would only surface then -- but now I can't reproduce it??? So this will be the only aside about it until I figure out what was going on.
Diffed the logs. What happened was that I was using RSFT
to trigger the sequence initially, and the problem disappeared because I started using LSFT
instead, which masks the issue by triggering a manual Release
. If I trigger the sequence with RSFT
, I can again observe that LSFT
is Press
'ed from before/during the sequence-bound macro's execution (causing unintended caps) until I manually tap it. I tried making the same swap in the simulator, but this bug does not appear to be reflected there.
I haven't checked to see what the status quo and history is (love the historical issues/discussions), but IMO modifiers should be released before macros are executed, suppressed, and restored if still held -- the burden should be on the user to define multiple macros / sequences if they want eg. abbr => abbreviation
, Abbr => Abbreviation
, and ABBR => ABBREVIATION
.
I'm not making a separate issue yet because these are basically my working notes and I think it's likely that the same code is at fault, but this is definitely a separate (and way less preference-based) bug that could warrant it's own issue if it ends up leading to another part of the code-base.
As an aside the design of sequence chords is here: https://github.com/jtroo/kanata/blob/main/docs/sequence-adding-chords-ideas.md
I should probably make sure all the useful bits out of that document make it into config.adoc
.
Awesome, thanks! I thought I'd have seen anything like that by now, crawling the web of code around parse_mod_prefix
; must be tunnel vision. Heh, still not working for my config but now I know it's on my end; I'll go find where grouping is implemented.
And my apologies, all these beautiful docs and examples and I haven't given them a through read-through; I see how this stemmed from the Press
-first approach.
Thank you for taking the time! <3
That just leaves the RSFT
behavior, which does persist. If we haven't got anything up our sleeves for that one, I'll be rooting around at least a little more (before (hopefully) reaching set-and-forget stability), and won't let it go un-grokked. Thx!
IMO it shouldn't matter if we press and release modifiers in-between letters in sequences either
parens
Oh, that means (S-(b b))
, and (S-b S-b))
are/can-be different -- I'm sure I can tweak that into matching my pref, and really, I'm just getting what I asked for :p
the burden should be on the user to define multiple macros / sequences
force users to be clear about what they mean and define the extra permutations, if they want them
hehe, exactly -- and I'm sure the macros'll be everything I could hope for c:
The parser seems to have a good pile of tests, but I don't see a place to put eg. a Simulator file for post-parsing tests?
This might be what you're looking for: https://github.com/jtroo/kanata/tree/main/src/tests/sim_tests
Requirements
Describe the bug
I believe that sequences such as
(defseq seq-name (a S-b S-c))
are intended to be valid when written as such and typed without liftingLSFT
betweenb
andc
. In practice, sequences with consecutive shifted characters don't activate like that. I demonstrate this by defining two sequences,aBa => x
andaBB => y
, and show that the latter always falls back to the former. This behavior is reflected in the online simulator.If the current behavior is intended it just needs to be explicit, but IMO it shouldn't matter if we press and release modifiers in-between letters in sequences either (as long as we continue within
sequence-timeout
). This would conflict with the use of a modifier as a dedicated key in a sequence, and you never know what people (like me?) will want, so I'm open to semantics and/or configuration options supporting both possibilities -- just something to have in mind while patching for this issue.Aside: I initially believed that enabling
visible-backspaced
consistently causedLSFT
to be leftDown
, as I observed that behavior and had to escape out of it withlctl+spc+esc
even after resetting tomaster
. I realized while writing the report that it made sense, because whenvisible-backspaced
isn't enabledLSFT
probably gets eaten anyways, so of course it would only surface then -- but now I can't reproduce it??? So this will be the only aside about it until I figure out what was going on. I do still have logs, but the setup was different.I've added my own debug statements to elucidate the issue, which is related to whether modifiers are removed from Sequence TrieKey's after being encoded into unused KeyCode bits at both parse- and run-time. They are encoded with a
Press
of shift explicitly preceding each shifted key, but at run-time users expect to be able to press shift once and hold it. This currently results in an invalid sequence, or in this case, a fall-back to another sequence with only the initial shift-press. Since the mods are encoded into theKeyCode
they should probably just be removed from Sequence keys entirely, but I'm not sure if this should happen inparse_action_atom
, in the Sequence-specific code, how it might effect other contexts, or why the modifier backtracking exists in the first-place (Chesterton fence).~I don't know why
LSFT
isn't released whenvisible-backspaced
is enabled, though it occurs to me as I type this that it's probably neverPress
'ed in the first place otherwise.~Relevant kanata config
To Reproduce
The online simulator can demonstrate this. Here we input
aBb
,aBB
(holding shift), andaBB
(with two shifts), observing the outputsx
(correct),x
(erroneous), andy
(correct).https://jtroo.github.io?data=BQEw...qggA
~But (if I'm reading correctly) it does not reflect that
LSFT
remains held whenvisible-backspaced
is enabled.~Expected behavior
What Should Happen
What Actually Happens
Without
visible-backspaced
:~With
visible-backspaced
:~Kanata version
kanata 1.6.0-prerelease-4 (d029299)
Debug logs
Without
visible-backspaced
:Input
aBb
: Correctly printsx
.Input
aBB
: Erroneously printsx
.~With
visible-backspaced
:~~▸ Details~
Operating system
Linux (Ubuntu-based)
Additional context
I've been poking around re: #950, doing awful things that shouldn't be up-streamed, and finally hit a bug that wasn't my fault :p
The parser seems to have a good pile of tests, but I don't see a place to put eg. a Simulator file for post-parsing tests?