GUI with Rotary Encoders

Hello, I woud like to have a Gui element similar to a rotary encoder.
Meaning something similiar to a poti that one can turn for an infinite amount to one direction. The output should identify in what direction the knob was turned.
is there a way to implement this?
I want to prototype a MIDI controller i’d like to build in supercollider and also have a gui for it, therefore i need this functionality.

For clarification, here is some example code for a potentiometer, but it’s printing between 0 and 1 and is only turn-able in a certain range. I’d like to have the direction printed and an infinite range of turn-ability.

(
var win, grid_size, knob_size;
knob_size = 40;
grid_size = knob_size + 10;
win = Window("gui", Rect(10, 10, grid_size * 4,grid_size * 4)).front;
Knob(win,Rect(0*(grid_size)+10, 30, knob_size, knob_size)).action_{|knob|knob.value.postln};
)

Is there some Gui element similar to this or how could i implement it?
Thank you very much!!

When thinking about it. I’m guessing to simply set a stepsize of 1 and only a horizontal mode would simulate an encoder:
Now a 1 would be a value clockwise and left a 0 is counter clockwise.

(
var win, grid_size, knob_size;
knob_size = 40;
grid_size = knob_size + 10;
win = Window("gui", Rect(10, 10, grid_size * 4,grid_size * 4)).front;
Knob(win,Rect(0*(grid_size)+10, 30, knob_size, knob_size))
.mode_(\horiz)
.step_(1)
.action_{|knob|knob.value.postln};
)