added key repeat functionality