zmk icon indicating copy to clipboard operation
zmk copied to clipboard

feat(behaviors): add universal snap tap behavior for gaming SOCD

Open sqdbruh opened this issue 8 months ago • 2 comments

Implements SOCD (Simultaneous Opposing Cardinal Directions) functionality that provides competitive gaming advantages through "last key wins" behavior for opposing directional keys.

Features:

  • Universal syntax: &st <opposing_key> works with any key pair
  • Dynamic state management supports up to 16 key pairs simultaneously
  • Memory efficient: only stores state for active pairs
  • Gaming optimized: perfect for FPS strafing, platformer movement, MOBA control
  • Zero performance impact when behavior is not used

Usage example: &st A D // A key with D as opposing key &st W S // W key with S as opposing key

The behavior solves the problem where pressing opposing keys (like A+D) causes character to stop moving by automatically releasing the previous key when its opposing key is pressed, enabling instant direction changes without dead zones

sqdbruh avatar Jun 16 '25 11:06 sqdbruh

related: #2391

lesshonor avatar Jun 16 '25 14:06 lesshonor

This seems a bit specific to me for a built-in behavior in ZMK. See modules like https://github.com/nguyendown/zmk-behavior-socd for an out-of-tree implementation.

caksoylar avatar Jun 16 '25 20:06 caksoylar