jtroo / kanata

Improve keyboard comfort and usability with advanced customization
GNU Lesser General Public License v3.0
2.13k stars 110 forks source link

Bug: Second character of macro disappears when it is used in chord #1199

Open nanikamado opened 4 weeks ago

nanikamado commented 4 weeks ago

Requirements

Describe the bug

The second character of macro disappears in certain conditions.

Relevant kanata config

(defsrc a b o)
(deflayer default
  (chord base a)
  (chord base b)
  (chord base o)
)
(defchords base 500
  (a) (macro a z)
  (b) (macro b)
  (o) o
  (a o) o
)

To Reproduce

The inputs and outputs are like this: https://jtroo.github.io?data=BQEwpgZgzgTgxgAgIYIEYIPYEoBQpIA2SAnmDAuBEgK4EAuOCCwcAFhjCGklGMrkxbtO3XmgHM2HLqh59sOXPghTOUUXwCsABm2NmSLMwC2SODAzIEALwnBUR4KfOWH+4NkzuUnjIoA+gUHBIf4gAFwA0mDEAIIIdOEAjLoUUTEAQgnJqdTpxFmJKXp50XHZAJy62kA

Expected behavior

The expected outputs would be something like this:

t:              100ms
out:   ↓(press) A
t:              1ms
out: ↑(release) A
t:              1ms
out:   ↓(press) Z
t:              1ms
out: ↑(release) Z
t:              1ms
out:   ↓(press) B
t:              1ms
out: ↑(release) B

Kanata version

kanata 1.7.0-prerelease-1

Debug logs

No response

Operating system

Linux

Additional context

No response

jtroo commented 4 weeks ago

Do debug logs show the second character being outputted? Perhaps your environment needs a delay due to events getting too rapid?

nanikamado commented 4 weeks ago

The second character is not being outputted also in the simulator, so I believe my environment is not relevant.

jtroo commented 4 weeks ago

I would guess the issue is not chord but instead simultaneously running macros

Potential workaround: https://jtroo.github.io?data=BQEwpgZgzgTgxgAgIYIEYIPYEoBQpIA2SAnmDAuBEgK4EAuOCCwcAFhjCGklGMrkxbtO3XmgHM2HLqh59sOXPghTOUUXwCsABm2NmSLMwC2tOgEtkCAF4TgqI6n3BsmZylcZFAH19--Ad4gAFwA0mDEAIIIdMEAjLoUYREAQjHxidTJxGmxCXpZ4VHpAJy62kA

Showcase of adding a delay, probably not a good workaround. https://jtroo.github.io?data=BQEwpgZgzgTgxgAgIYIEYIPYEoBQpIA2SAnmDAuBEgK4EAuOCCwcAFhjCGklGMrkxbtO3XmgHM2HLqh59sOXPghTOUUXwCsABm2NmSLMwC2SODAzIEALwnBUR4KfOWATOP3BsmTym8ZFAB9gkNCwwJAALgBpMGIAQQQ6SIBGXQoYuIAhJNT06kziHOS0vQLYhNyATl1tIA

nanikamado commented 4 weeks ago

multi worked for my use case. Thank you.

nanikamado commented 3 weeks ago

Turns out that multi also can not be used for my use case, because the same key can not be repeated with multi.

For example, in this case, the output I want is like ↓A ↓Z ↑A ↑Z ↓Z ↑Z or ↓A ↑A ↓Z ↑Z ↓Z ↑Z.