Make the mouse emulation work correctly