added mouse locking based on menu display