define getKeyDirection method to Keyboard