Ok, I think this recreates Peter's macro:
However, performance seems to be much worse than in Peter's example. Does anyone know, if performance could be improved. I certainly don't expect this macro to respond super quickly, but the example Peter shows looks much more real-time.
Edit: And now I have simplified it to this, still the same problem:

