Fix keyboard input issue.
Ignore unused events.
Fix mouse handling.