Register functions for key down and up events added and implemented.