Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rpt-any #392

Merged
merged 6 commits into from
May 20, 2023
Merged

feat: add rpt-any #392

merged 6 commits into from
May 20, 2023

Conversation

jtroo
Copy link
Owner

@jtroo jtroo commented May 6, 2023

Implements #389

I haven't tested this. Seems like I could add a unit test to keyberon for this. Will publish for now in case someone wants to do manual testing for me though 😁

@lelazsq
Copy link

lelazsq commented May 7, 2023

just tried it but it doesn't work. when i press rpt-any, it just pauses and doesn't output any input you make for a couple seconds.

@jtroo
Copy link
Owner Author

jtroo commented May 7, 2023

just tried it but it doesn't work. when i press rpt-any, it just pauses and doesn't output any input you make for a couple seconds.

Interesting, I added a unit test (without changing the code logic) and did some manual testing today and it's working as intended for me. I'm not able to reproduce the pause.

@amospalla
Copy link

amospalla commented May 7, 2023

I've tried this patch. Tried to repeat a Control+V (paste) action, but instead of repeating it it only repeated the "V" key.

I've used only keys on the main layer to test it (to be on the simpler side of things).

Interestingly enough, it added an unexpected feature I find useful, being able to repeat a key, not only one time like rpt does, but with holding it keeps repeating the key (but only works if the rpt-any action is on the base layer).

Press and hold "Control":

kind: Key(KEY_LEFTCTRL), value: 1
11:25:19 [TRACE] (1) kanata::kanata::linux: [src/kanata/linux.rs:27] [InputEvent { time: SystemTime { tv_sec: 1683451519, tv_nsec: 627777000 }, kind: Key(KEY_LEFTCTRL), value: 1 }, InputEvent { time: SystemTime { tv_sec: 1683451519, tv_nsec: 627777000 }, kind: Synchronization(SYN_REPORT), value: 0 }]
11:25:19 [TRACE] (1) kanata::oskbd::linux: [src/oskbd/linux.rs:114] polling
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:573] LCtrl is pressed
11:25:19 [DEBUG] (2) kanata::kanata: key press     LCtrl
11:25:19 [DEBUG] (2) kanata::oskbd::linux: input ev: InputEvent { time: SystemTime { tv_sec: 0, tv_nsec: 0 }, kind: Key(KEY_LEFTCTRL), value: 1 }
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:1259] blocking on channel

kind: Key(KEY_LEFTCTRL), value: 2
11:25:19 [TRACE] (1) kanata::kanata::linux: [src/kanata/linux.rs:27] [InputEvent { time: SystemTime { tv_sec: 1683451519, tv_nsec: 890003000 }, kind: Key(KEY_LEFTCTRL), value: 2 }, InputEvent { time: SystemTime { tv_sec: 1683451519, tv_nsec: 890003000 }, kind: Synchronization(SYN_REPORT), value: 0 }]
11:25:19 [TRACE] (1) kanata::oskbd::linux: [src/oskbd/linux.rs:114] polling
11:25:19 [DEBUG] (2) kanata::kanata: key outs for default layer: [KEY_LEFTCTRL];
11:25:19 [DEBUG] (2) kanata::kanata: repeat    LCtrl

kind: Key(KEY_LEFTCTRL), value: 2
11:25:19 [DEBUG] (2) kanata::oskbd::linux: input ev: InputEvent { time: SystemTime { tv_sec: 0, tv_nsec: 0 }, kind: Key(KEY_LEFTCTRL), value: 2 }
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:573] LCtrl is pressed
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:575] LCtrl is contained
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:1259] blocking on channel

Press "V":

kind: Key(KEY_V), value: 1
11:25:19 [TRACE] (1) kanata::kanata::linux: [src/kanata/linux.rs:27] [InputEvent { time: SystemTime { tv_sec: 1683451519, tv_nsec: 899809000 }, kind: Key(KEY_V), value: 1 }, InputEvent { time: SystemTime { tv_sec: 1683451519, tv_nsec: 899809000 }, kind: Synchronization(SYN_REPORT), value: 0 }]
11:25:19 [TRACE] (1) kanata::oskbd::linux: [src/oskbd/linux.rs:114] polling
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:573] LCtrl is pressed
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:575] LCtrl is contained
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:573] V is pressed
11:25:19 [DEBUG] (2) kanata::kanata: key press     V
11:25:19 [DEBUG] (2) kanata::oskbd::linux: input ev: InputEvent { time: SystemTime { tv_sec: 0, tv_nsec: 0 }, kind: Key(KEY_V), value: 1 }
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:1259] blocking on channel

Release "V":

kind: Key(KEY_V), value: 0
11:25:19 [TRACE] (1) kanata::kanata::linux: [src/kanata/linux.rs:27] [InputEvent { time: SystemTime { tv_sec: 1683451519, tv_nsec: 947753000 }, kind: Key(KEY_V), value: 0 }, InputEvent { time: SystemTime { tv_sec: 1683451519, tv_nsec: 947753000 }, kind: Synchronization(SYN_REPORT), value: 0 }]
11:25:19 [TRACE] (1) kanata::oskbd::linux: [src/oskbd/linux.rs:114] polling
11:25:19 [DEBUG] (2) kanata::kanata: key release   V
11:25:19 [DEBUG] (2) kanata::oskbd::linux: input ev: InputEvent { time: SystemTime { tv_sec: 0, tv_nsec: 0 }, kind: Key(KEY_V), value: 0 }
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:573] LCtrl is pressed
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:575] LCtrl is contained
11:25:19 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:1259] blocking on channel

Release "Control":

kind: Key(KEY_LEFTCTRL), value: 0
11:25:20 [TRACE] (1) kanata::kanata::linux: [src/kanata/linux.rs:27] [InputEvent { time: SystemTime { tv_sec: 1683451520, tv_nsec: 139813000 }, kind: Key(KEY_LEFTCTRL), value: 0 }, InputEvent { time: SystemTime { tv_sec: 1683451520, tv_nsec: 139813000 }, kind: Synchronization(SYN_REPORT), value: 0 }]
11:25:20 [TRACE] (1) kanata::oskbd::linux: [src/oskbd/linux.rs:114] polling
11:25:20 [DEBUG] (2) kanata::kanata: key release   LCtrl
11:25:20 [DEBUG] (2) kanata::oskbd::linux: input ev: InputEvent { time: SystemTime { tv_sec: 0, tv_nsec: 0 }, kind: Key(KEY_LEFTCTRL), value: 0 }
11:25:20 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:1259] blocking on channel

Press "Tab" (which has key-rpt action):
Does not send "Control + v", but only "V".

kind: Key(KEY_TAB), value: 1
11:25:23 [TRACE] (1) kanata::kanata::linux: [src/kanata/linux.rs:27] [InputEvent { time: SystemTime { tv_sec: 1683451523, tv_nsec: 787797000 }, kind: Key(KEY_TAB), value: 1 }, InputEvent { time: SystemTime { tv_sec: 1683451523, tv_nsec: 787797000 }, kind: Synchronization(SYN_REPORT), value: 0 }]
11:25:23 [TRACE] (1) kanata::oskbd::linux: [src/oskbd/linux.rs:114] polling
11:25:23 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:573] V is pressed
11:25:23 [DEBUG] (2) kanata::kanata: key press     V
11:25:23 [DEBUG] (2) kanata::oskbd::linux: input ev: InputEvent { time: SystemTime { tv_sec: 0, tv_nsec: 0 }, kind: Key(KEY_V), value: 1 }
11:25:23 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:1259] blocking on channel

kind: Key(KEY_TAB), value: 0
11:25:23 [TRACE] (1) kanata::kanata::linux: [src/kanata/linux.rs:27] [InputEvent { time: SystemTime { tv_sec: 1683451523, tv_nsec: 867876000 }, kind: Key(KEY_TAB), value: 0 }, InputEvent { time: SystemTime { tv_sec: 1683451523, tv_nsec: 867876000 }, kind: Synchronization(SYN_REPORT), value: 0 }]
11:25:23 [TRACE] (1) kanata::oskbd::linux: [src/oskbd/linux.rs:114] polling
11:25:23 [DEBUG] (2) kanata::kanata: key release   V
11:25:23 [DEBUG] (2) kanata::oskbd::linux: input ev: InputEvent { time: SystemTime { tv_sec: 0, tv_nsec: 0 }, kind: Key(KEY_V), value: 0 }
11:25:23 [TRACE] (2) kanata::kanata: [src/kanata/mod.rs:1259] blocking on channel

@rszyma
Copy link
Contributor

rszyma commented May 7, 2023

Interestingly enough, it added an unexpected feature I find useful, being able to repeat a key, not only one time like rpt does, but with holding it keeps repeating the key (but only works if the rpt-any action is on the base layer).

There's already a stable feature for that, that was added not-too-long time ago: macro-repeat-release-cancel or macro-repeat

@lelazsq
Copy link

lelazsq commented May 7, 2023

Interesting, I added a unit test (without changing the code logic) and did some manual testing today and it's working as intended for me. I'm not able to reproduce the pause.

weird, i could try recording me pressing rpt-any and showing you what happens

@jtroo
Copy link
Owner Author

jtroo commented May 8, 2023

In testing some more, I fixed a potential usability issue with multi and the rpt-any action. I'll just repeat the comment I added since it explains the issue ok I think.

// Multi is probably the one action where it is desirable to repeat the top-level
// action instead of the final action. The final action meaning a hold action in
// `tap-hold` or the 3rd tap of a `tap-dance`.
//
// Set the prev_action again since it was probably overwritten by the
// `do_action` recursion.

While writing this though, I wonder if there are other actions where it would make sense to repeat the top-level instead of the final. Maybe one-shot or fork?

@jtroo
Copy link
Owner Author

jtroo commented May 8, 2023

Testing again after this multi fix, I'm not seeing any issues still.

Space is rpt-any and q w e r are t01-t04 in order (US layout).

(defalias
  t01 (multi a b c)
  t02 (multi S-a b c)
  t03 S-b
  t04 (macro 100 S-a b c d)
)
Debug output
22:58:12 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Q, state: DOWN, information: 0 }
22:58:12 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_Q, value: Press } to processing loop
22:58:12 [DEBUG] (2) kanata::kanata: key press     A
22:58:12 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: DOWN, information: 0 } to driver
22:58:12 [DEBUG] (2) kanata::kanata: key press     B
22:58:12 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: DOWN, information: 0 } to driver
22:58:12 [DEBUG] (2) kanata::kanata: key press     C
22:58:12 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: DOWN, information: 0 } to driver
22:58:12 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Q, state: UP, information: 0 }
22:58:12 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_Q, value: Release } to processing loop
22:58:12 [DEBUG] (2) kanata::kanata: key release   A
22:58:12 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: UP, information: 0 } to driver
22:58:12 [DEBUG] (2) kanata::kanata: key release   B
22:58:12 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: UP, information: 0 } to driver
22:58:12 [DEBUG] (2) kanata::kanata: key release   C
22:58:12 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: UP, information: 0 } to driver
22:58:14 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Space, state: DOWN, information: 0 }
22:58:14 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_SPACE, value: Press } to processing loop
22:58:14 [DEBUG] (2) kanata::kanata: key press     A
22:58:14 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: DOWN, information: 0 } to driver
22:58:14 [DEBUG] (2) kanata::kanata: key press     B
22:58:14 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: DOWN, information: 0 } to driver
22:58:14 [DEBUG] (2) kanata::kanata: key press     C
22:58:14 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: DOWN, information: 0 } to driver
22:58:14 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Space, state: UP, information: 0 }
22:58:14 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_SPACE, value: Release } to processing loop
22:58:14 [DEBUG] (2) kanata::kanata: key release   A
22:58:14 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: UP, information: 0 } to driver
22:58:14 [DEBUG] (2) kanata::kanata: key release   B
22:58:14 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: UP, information: 0 } to driver
22:58:14 [DEBUG] (2) kanata::kanata: key release   C
22:58:14 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: UP, information: 0 } to driver
22:58:19 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: W, state: DOWN, information: 0 }
22:58:19 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_W, value: Press } to processing loop
22:58:19 [DEBUG] (2) kanata::kanata: key press     LShift
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: DOWN, information: 0 } to driver
22:58:19 [DEBUG] (2) kanata::kanata: key press     A
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: DOWN, information: 0 } to driver
22:58:19 [DEBUG] (2) kanata::kanata: key press     B
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: DOWN, information: 0 } to driver
22:58:19 [DEBUG] (2) kanata::kanata: key press     C
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: DOWN, information: 0 } to driver
22:58:19 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: W, state: UP, information: 0 }
22:58:19 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_W, value: Release } to processing loop
22:58:19 [DEBUG] (2) kanata::kanata: key release   LShift
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:19 [DEBUG] (2) kanata::kanata: key release   A
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: UP, information: 0 } to driver
22:58:19 [DEBUG] (2) kanata::kanata: key release   B
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: UP, information: 0 } to driver
22:58:19 [DEBUG] (2) kanata::kanata: key release   C
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: UP, information: 0 } to driver
22:58:19 [DEBUG] (2) kanata::kanata::windows: releasing all LShift
22:58:19 [DEBUG] (2) kanata::kanata::windows: releasing LShift from pressed keys
22:58:19 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:20 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Space, state: DOWN, information: 0 }
22:58:20 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_SPACE, value: Press } to processing loop
22:58:20 [DEBUG] (2) kanata::kanata: key press     LShift
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: DOWN, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata: key press     A
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: DOWN, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata: key press     B
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: DOWN, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata: key press     C
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: DOWN, information: 0 } to driver
22:58:20 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Space, state: UP, information: 0 }
22:58:20 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_SPACE, value: Release } to processing loop
22:58:20 [DEBUG] (2) kanata::kanata: key release   LShift
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata: key release   A
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: UP, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata: key release   B
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: UP, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata: key release   C
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: UP, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata::windows: releasing all LShift
22:58:20 [DEBUG] (2) kanata::kanata::windows: releasing LShift from pressed keys
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:20 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: E, state: DOWN, information: 0 }
22:58:20 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_E, value: Press } to processing loop
22:58:20 [DEBUG] (2) kanata::kanata: key press     LShift
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: DOWN, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata: key press     B
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: DOWN, information: 0 } to driver
22:58:20 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: E, state: UP, information: 0 }
22:58:20 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_E, value: Release } to processing loop
22:58:20 [DEBUG] (2) kanata::kanata: key release   LShift
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata: key release   B
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: UP, information: 0 } to driver
22:58:20 [DEBUG] (2) kanata::kanata::windows: releasing all LShift
22:58:20 [DEBUG] (2) kanata::kanata::windows: releasing LShift from pressed keys
22:58:20 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:21 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Space, state: DOWN, information: 0 }
22:58:21 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_SPACE, value: Press } to processing loop
22:58:21 [DEBUG] (2) kanata::kanata: key press     LShift
22:58:21 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: DOWN, information: 0 } to driver
22:58:21 [DEBUG] (2) kanata::kanata: key press     B
22:58:21 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: DOWN, information: 0 } to driver
22:58:21 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Space, state: UP, information: 0 }
22:58:21 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_SPACE, value: Release } to processing loop
22:58:21 [DEBUG] (2) kanata::kanata: key release   LShift
22:58:21 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:21 [DEBUG] (2) kanata::kanata: key release   B
22:58:21 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: UP, information: 0 } to driver
22:58:21 [DEBUG] (2) kanata::kanata::windows: releasing all LShift
22:58:21 [DEBUG] (2) kanata::kanata::windows: releasing LShift from pressed keys
22:58:21 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:22 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: R, state: DOWN, information: 0 }
22:58:22 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_R, value: Press } to processing loop
22:58:22 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: R, state: UP, information: 0 }
22:58:22 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_R, value: Release } to processing loop
22:58:22 [DEBUG] (2) kanata::kanata: key press     LShift
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: DOWN, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key press     A
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: DOWN, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key release   A
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: UP, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key release   LShift
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key press     B
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: DOWN, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key release   B
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: UP, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key press     C
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: DOWN, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key release   C
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: UP, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key press     D
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: D, state: DOWN, information: 0 } to driver
22:58:22 [DEBUG] (2) kanata::kanata: key release   D
22:58:22 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: D, state: UP, information: 0 } to driver
22:58:24 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Space, state: DOWN, information: 0 }
22:58:24 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_SPACE, value: Press } to processing loop
22:58:24 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: Space, state: UP, information: 0 }
22:58:24 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_SPACE, value: Release } to processing loop
22:58:24 [DEBUG] (2) kanata::kanata: key press     LShift
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: DOWN, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key press     A
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: DOWN, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key release   A
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: A, state: UP, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key release   LShift
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: LeftShift, state: UP, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key press     B
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: DOWN, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key release   B
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: B, state: UP, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key press     C
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: DOWN, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key release   C
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: C, state: UP, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key press     D
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: D, state: DOWN, information: 0 } to driver
22:58:24 [DEBUG] (2) kanata::kanata: key release   D
22:58:24 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Keyboard { code: D, state: UP, information: 0 } to driver

The output is as expected - note that t02 looks a little funny, but is expected because the S of S-a isn't released until after everything else is pressed too:

abcabcABCABCBBAbcdAbcd

Some --debug or --trace output would be helpful when reproducing the issue!

@rszyma
Copy link
Contributor

rszyma commented May 8, 2023

I don't know if this is intended, but when using this action (tap-hold 1 200 a (layer-while-held a-mod-while-held)) and accessing rpt-any from a-mod-while-held layer outputs nothing.

@lelazsq
Copy link

lelazsq commented May 8, 2023

I don't know if this is intended, but when using this action (tap-hold 1 200 a (layer-while-held a-mod-while-held)) and accessing rpt-any from a-mod-while-held layer outputs nothing.

yep i had a problem with putting rpt-any on a tap-hold key so this might be related

@jtroo
Copy link
Owner Author

jtroo commented May 9, 2023

That sounds like it might be the issue. The current rpt-any allows any action, including layer-switch or layer-while-held, to be repeated. So switching to another layer will overwrite what's already stored as the "previous action".

If there is no good use case for allowing these layer actions to be repeated though (and I can't think of any right now), I could special-case these out to not be repeatable.

@jtroo jtroo merged commit c4d4b4f into main May 20, 2023
3 checks passed
@jtroo jtroo deleted the rpt-any branch May 20, 2023 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants