Updated the keyup and keydown event implementations. Added the keypress event implementation.