Fix middle mouse button handling on Windows and Mac