windows port of mouse code