I need help with keydown and keyup events

Thank you for the reply. The problem with requestanimationframe is I can’t change the frame rate for my animation. Its too fast.