Question about qmk and rotary encoders

I was hoping to get some clarification on the matter of programming rotary encoders on a Kyria. I have been over the encoder section of the qmk doc, however, I am very new to programming and I would be grateful if you would please consider explaining this to me like I’m 5.

So I have a default Kyria keymap open in VS Code for editing, and when it comes to the encoder, I see this at the bottom of the page:

I can see that there are different functions assigned to the rotation of the encoder which seems fairly straightforward. But higher up on the page, in the layer keymaps where there is a visual representation of each layer followed by its dedignated key codes, unless I missed something I do not see any specific key slot designated for an encoder. Here’s the default home layer in the same keymap:

So let’s say that I wanted the encoders in these same spots (borrowed this image from the internet):

On the QWERTY layer I shared above, the encoders would be in the KC_LGUI and KC_RALT key slots:

So how does this actually work? Does the ENCODER=ENABLE styling at the very bottom of the keymap override the designated layer keycodes if there is a rotary encoder installed in the slot instead of a key switch?

I hope that makes sense, I can clarify if it would be helpful.

I don’t have a complete answer to your question but one thing to note is that most encoders come with a “push” function that QMK treats just like a switch being pressed so it’s likely, if the ENCODER=ENABLE declaration does work, that QMK would interpret GUI and AltGr as the key codes for when you press the encode down.

1 Like

Thank you, that makes sense. Have you ever programed a kb with an encoder on it?