Added more unit tests for mouse and keyboard events.

N.B.: this will likely fail in Travis CI.