Need help with rotary encoder code for menu navigation.

Hi,

I am creating a arduino LoRa module to communicate with another module which shall be installed in my RC plane.

The ground module has a rotary encoder to scroll trough its menus, i was trying to get it to work but then i noticed that this rotary encoder operates at a different sequence than the normal encoders...

If you look at the picture below i have tried to show what the a and b terminal outputs in one sequence, and if i turn the encoder backwards it doesnt reverse the sequence but instead messes it up?

is there a special code for this encoder?

Thanks

dave-in-nj:
https://www.youtube.com/watch?v=ak5TsUFhyf8

I edited the post, if you look now you can see the behaviour of the encoder

4 positions ? they are both exactly the same.
looks more like a switch as it is only 4 positions.
what is odd is that you say it it working in reverse, but it clearly moves to the next step.

But since you can use them to know what the last was, and what the next is, you know the direction.
the key is to never move too fast so that a step is lost.

Take 12 steps forward, then back and you should find that they align perfectly.

the video should help understand how to make this work.

dave-in-nj:
4 positions ? they are both exactly the same.
looks more like a switch as it is only 4 positions.

No, it has 20 positions but if you turn it 1 step clockwise you get the cw sequence
and if you turn it 1 step counter clockwise you get the ccw sequence