figured it out thanks!
Why don't you use an interrupt for the keystroke and let the loop handle the mouse movement?
Let us know if you need help programming it.
Alternatively, you can use millis() to time the 20ms, so that the loop keeps running and doesn't eat up the microcontroller cycles. This is explained here: Using millis() for timing | Multi-tasking the Arduino - Part 1 | Adafruit Learning System