Stop repeated keypresses from causing lag

Currently, holding the up key or down key causes scrolling to lag as animate() is called repeatedly in rapid succession. This commit fixes this problem by ignoring up/down keypresses while scrolling is already happening.