func detectMouseLocation(){ let mouseLocation = NSEvent.mouseLocation let mouseInRect = NSMouseInRect( ... ) ... return mouseInRect }