refactored movement key events method