incorporated keystroke recognition

now able to recognize keystrokes. Some operations still need to be
implemented.