Fix regression in mouse code introduced in 0fb1111