Changed Linux keyboard/mouse implementation to make event handling easier for the user.