The resolution (in distance travelled) you can measure, say at 60 fps and with that speed of 330 pixels/second, is like 6 pixels.
So, on the moment you measure that x, the object made an overshoot of between 1 and 6 pixels. And then you send it back 6 pixels.
Back 6 pixels? Ah yes, because the next moment that you can measure it travelled at least 6 pixels. Well, probably 4 due the acceleration.
So, next tick, same thing happens, it just overshoots on the other side, and now it oscillates between two overshoot positions.
Besides that. When you stop emulating/pressing the key, the deceleration kicks in,
well at 5000 pixels/second that is not that much extra distance travelled, guess you got that one.
https://www.dropbox.com/s/1la0xish5b3e3 ... .capx?dl=0