Refactored initiative logic and add keyboard input events