Can it have anything to do with the fact that i've connected the switch to pin 5 (with a pull-up resistor. I've tried both a 10k and the internal pullup as suggested by someone here)?
The push button switch on these encoders should be unrelated to the quadrature counting. If you don't connect the switch at all, do you still see the anomalies in the counts?
My advice to you would be to start a new thread, show your wiring, your code, and describe your specific problem. Pick a new title like "Keyes rotary encoder continues to count when not rotated". You will get more eyes on the problem that when tagging on to the bottom of an old thread which does not really address your problem.