The much harder part when designing the iPods themselves was to build a robust touch sensor given the hardware of the day, and actually come up with pleasing dimensions and quantization parameters as a designer!
Code for this implementation: https://github.com/tvillarete/ipod-classic-js/blob/master/sr...
> ... you just need to quantize the angle ... look at the event stream ... and take the sign of the pairwise difference
This is harder than I thought
Round the angle quite severely. E.g. if using 10 degree steps you'd round anything below 5 degrees to 0 degrees, and anything above to 10 degrees. Anything above 15 would get rounded to 20, and so on.
> look at the event stream
Look at the last two directions the above procedure generated.
> and take the sign of the pairwise difference
If the new angle is higher it's a counterclockwise motion. If the new angle is lower it's a clockwise motion. Do some special handling if the angle wraps around from 350 to 0 degrees or vice versa.
It did have haptic feedback on the wheel which was cool, although I think this web implementation actually does a better job of nailing the motion and feel of the click wheel itself.
looks like you could maybe use the Vibrate API for some andriod browsers…