fix error logging in key/mouse events