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

[Bug] SH_T Swap-hands action produces extra tap depending on timing #24410

Open
ilikeheaps opened this issue Sep 19, 2024 · 8 comments
Open

[Bug] SH_T Swap-hands action produces extra tap depending on timing #24410

ilikeheaps opened this issue Sep 19, 2024 · 8 comments

Comments

@ilikeheaps
Copy link

ilikeheaps commented Sep 19, 2024

I have r key mirrored to i. Quick SH_T(KC_SPC) + r combination results in i while doing it slowly results in i as expected. Logs below contain both cases in order.

ilikeheaps:plyboard:1: ---- action_exec: start -----
ilikeheaps:plyboard:1: EVENT: 0305d(21482)
ilikeheaps:plyboard:1: Tapping: Start(Press tap key).
ilikeheaps:plyboard:1: TAPPING_KEY=0305d(21482):0 
ilikeheaps:plyboard:1: processed: 0305d(21482):0 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: ---- action_exec: start -----
ilikeheaps:plyboard:1: EVENT: 0102d(21553)
ilikeheaps:plyboard:1: waiting_buffer_enq: { [7]=0602d(21553):0  }
ilikeheaps:plyboard:1: ---- action_exec: process waiting_buffer -----
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: ---- action_exec: start -----
ilikeheaps:plyboard:1: EVENT: 0305u(21590)
ilikeheaps:plyboard:1: Tapping: First tap(0->1).
ilikeheaps:plyboard:1: TAPPING_KEY=0305d(21482):1-
ilikeheaps:plyboard:1: ACTION: ACT_SWAP_HANDS[0:2C] layer_state:  default_layer_state: 
ilikeheaps:plyboard:1: keyboard_report: 00 | 2C 00 00 00 00 00 
ilikeheaps:plyboard:1: waiting_buffer_enq: { [7]=0602d(21553):0  [0]=0305u(21590):1- }
ilikeheaps:plyboard:1: ---- action_exec: process waiting_buffer -----
ilikeheaps:plyboard:1: Tapping: key event while last tap(>0).
ilikeheaps:plyboard:1: ACTION: ACT_LMODS[0:0F] layer_state:  default_layer_state: 
ilikeheaps:plyboard:1: keyboard_report: 00 | 2C 0F 00 00 00 00 
ilikeheaps:plyboard:1: processed: waiting_buffer[7] =0602d(21553):0 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: Tapping: Tap release(1)
ilikeheaps:plyboard:1: ACTION: ACT_SWAP_HANDS[0:2C] layer_state:  default_layer_state: 
ilikeheaps:plyboard:1: keyboard_report: 00 | 00 0F 00 00 00 00 
ilikeheaps:plyboard:1: TAPPING_KEY=0000u(0):0 
ilikeheaps:plyboard:1: processed: waiting_buffer[0] =0000u(0):0 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: ---- action_exec: start -----
ilikeheaps:plyboard:1: EVENT: 0102u(21626)
ilikeheaps:plyboard:1: ACTION: ACT_LMODS[0:0F] layer_state:  default_layer_state: 
ilikeheaps:plyboard:1: keyboard_report: 00 | 00 00 00 00 00 00 
ilikeheaps:plyboard:1: processed: 0602u(21626):0 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: ---- action_exec: start -----
ilikeheaps:plyboard:1: EVENT: 0305d(23288)
ilikeheaps:plyboard:1: Tapping: Start(Press tap key).
ilikeheaps:plyboard:1: TAPPING_KEY=0305d(23288):0 
ilikeheaps:plyboard:1: processed: 0305d(23288):0 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: Tapping: End. Timeout. Not tap(0): 0000u(23488)
ilikeheaps:plyboard:1: ACTION: ACT_SWAP_HANDS[0:2C] layer_state:  default_layer_state: 
ilikeheaps:plyboard:1: TAPPING_KEY=0000u(0):0 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: ---- action_exec: start -----
ilikeheaps:plyboard:1: EVENT: 0102d(23572)
ilikeheaps:plyboard:1: ACTION: ACT_LMODS[0:0F] layer_state:  default_layer_state: 
ilikeheaps:plyboard:1: keyboard_report: 00 | 0F 00 00 00 00 00 
ilikeheaps:plyboard:1: processed: 0602d(23572):0 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: ---- action_exec: start -----
ilikeheaps:plyboard:1: EVENT: 0102u(23798)
ilikeheaps:plyboard:1: ACTION: ACT_LMODS[0:0F] layer_state:  default_layer_state: 
ilikeheaps:plyboard:1: keyboard_report: 00 | 00 00 00 00 00 00 
ilikeheaps:plyboard:1: processed: 0602u(23798):0 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: 
ilikeheaps:plyboard:1: ---- action_exec: start -----
ilikeheaps:plyboard:1: EVENT: 0305u(23843)
ilikeheaps:plyboard:1: ACTION: ACT_SWAP_HANDS[0:2C] layer_state:  default_layer_state: 
ilikeheaps:plyboard:1: processed: 0305u(23843):0 
@ilikeheaps

This comment was marked as outdated.

@ilikeheaps

This comment was marked as outdated.

@ilikeheaps

This comment was marked as duplicate.

@ilikeheaps

This comment was marked as duplicate.

@ilikeheaps
Copy link
Author

ilikeheaps commented Sep 20, 2024

Okay, found the (edit: an?) issue: I should read the manual and use PERMISSIVE_HOLD. Well, I did read it but didn't notice different tapping modes when reading about swap-hands and one shot modifiers. I assumed PERMISSIVE_HOLD behaviour when reading keys descriptions:

The Mod-Tap key MT(mod, kc) acts like a modifier when held, and a regular keycode when tapped. In other words, you can have a key that sends Escape when you tap it, but functions as a Control or Shift key when you hold it down.

SH_T(kc) -- Momentary swap when held, kc when tapped

Anyway:

  1. SH_T still breaks the description - it works as both SH toggle and tap in the same press
  2. I didn't find tests for swap-hands, would anyone like to see PR with mine after I fix their configuration?

@ilikeheaps
Copy link
Author

I've set PERMISSIVE_HOLD for my keyboard but I am still having issues. Perhaps I will try to refine tests to isolate the problem.

@ilikeheaps

This comment was marked as duplicate.

@ilikeheaps
Copy link
Author

ilikeheaps commented Sep 21, 2024

Posted my tests (one failing, bug or wrong assumptions?) in #24420

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant