Clean up

Clean up redundant variables.
Change the check condition for bypassing the event to just plain
character. Only character keys with/without shift keys trigger keypress
event. Any CTRL or ALT key combination doesn't.
Clean up test file.