Log keyboard and mouse events.