splitkb.com

Fixing encoder skipping in QMK firmware

If you're using QMK or Vial, you may need to change your encoder's resolution.

When to use

You should use this document when you're using and/or experiencing the following.

Products

This page applies to the following products:

Situations

Use this page when:

  • You are using QMK or Vial firmware.
  • You need to turn your rotary encoder for two "ticks" for your keyboard to perform one action.

Expected outcome

After following the instructions on this page:

  • The keyboard performs one action for every one "tick" while turning the encoder.

When to avoid

Do not use this page when:

  • You are using any other encoder. The ALPS Gray encoder is discontinued.

Not all encoders are the same. Depending on your encoder, you may need to alter your firmware for it to properly pick up all the rotations of your encoder.

By default, the encoder resolution is set to 4. If you use the gray EC11K Industrial Encoder, you should use a resolution of 2. If you don't, it will drop every other action when you rotate the encoder.

When using info.json or keyboard.json

Find the encoder object in your file, and add the resolution property to it. It will look similar to:

"encoder": {
    "enabled": true,
    "rotary": [
        {"pin_a": "F4", "pin_b": "F5"}
    ],
    "resolution": 2
},

Compile your firmware and flash it to both sides of your keyboard, and the encoder should work properly again.

When using config.h

Add the following to your config.h file:

// EC11K encoders have a different resolution than other EC11 encoders.  
// When using the default resolution of 4, if you notice your encoder skipping  
// every other tick, lower the resolution to 2.  
#define ENCODER_RESOLUTION 2

Compile your firmware and flash it to both sides of your keyboard, and the encoder should work properly again.


Questions? Help us improve!
Do you have questions after reading the documentation? Do you have feedback about this page, or about the documentation in general? Please send us an email. You can use the buttons below which will open your mail client or app with a template, or send your mail to support@splitkb.com.