Skip to content

Conversation

@replicaJunction
Copy link
Contributor

Fix a couple of quirks about the encoder support I introduced in #1:

Encoder Direction

ZMK's encoder support uses "increment" and "decrement" nomenclature, like this:

&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN

Previously, the A and B pins were reversed in the config so the "increment" action was in the second position in this macro instead of the first one.

This is purely semantics - the keymaps would work either way - but this swap helps the keymap to match examples from ZMK docs and other keyboards more closely.

Resolution

The steps and triggers-per-rotation seemed to be incorrect; the encoder was usually sending two keystrokes per single, tactile bump.

I don't know the exact model number or datasheet of the encoder used by this keyboard, so I had to guess and check at the proper values for these two settings. I settled on these values for a couple different reasons:

  1. Recommendation by @ujl123, who got the LEDs working in my previous PR Add support for ZMK Studio, rotary encoders, and LEDs #1
  2. Matches the defaults in the example code on the ZMK docs for encoders
  3. Recommendation on the ZMK Discord (see below):

You should probably stick with the same 80 steps/20 triggers-per-rotation most generic Alps-clone encoders use to start, unless you can provide a specific datasheet for yours.

Using these values, I do still experience an occasional "drop" or missed input from the encoder (maybe once out of every 15-20 times), but most of the time one tactile bump sends one keypress. In my opinion, that's a better experience overall.

Fix an issue where the encoder's direction was reversed in ZMK
("increment" and "decrement" were reporting backwards).

Not a huge deal since it could be corrected in the keymaps, but it's
more convenient when it matches the ZMK docs.

Signed-off-by: Joshua T <[email protected]>
Signed-off-by: Joshua T <[email protected]>
@replicaJunction
Copy link
Contributor Author

I developed this and #2 in parallel, but chose to split them out for cleanliness. They are compatible, and I have merged them locally with no merge conflicts. If you would prefer I combine them into one PR instead, let me know and I'd be happy to do so.

@obra obra merged commit a8c8f75 into keyboardio:main Aug 6, 2025
4 checks passed
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.

2 participants