Rotary encoder 4 choices

Hi all thank you for the ideas and contribution

Cattledog solution is the one i need i think

I just need it for 4 choices, the encoder i have has also a push button
if a choice is made for instance south i put a digital output high if i rotate for instance to
west i put the another digital input high an the digital input of south low

That would be the setup, but how to code this with a rotary encoder ?

Greetings
Fred