FSM mouse logic