[BUG #7145] Only register the mouse emulation handler if the environment key is enabled.