port repeating buttons from old version

I planned to rewrite it but it wasn't that bad :D