How can I stock data, and send them over by serial?
There is no such thing as "all at once" with serial. The whole point of serial is that it sends things one character at a time.

It is entirely up to you to decide what constitutes one "block" of data.

There is absolutely no difference (besides some slight processing overheads) between:

Serial.print("Hello");
Serial.print(" ");
Serial.println("World");


and:

Serial.println("Hello World");


Both of them result in Serial sending:

H
e
l
l
o
[space]
W
o
r
l
d
[cr]
[lf]


No matter how you "batch" stuff together (or attempt to) it makes no difference.

You need to have:


Some way of identifying the start of a block of data,
A mechanism to receive the entire block a byte at a time, and
Some way of identifying the end of a block of data.


How you do that is entirely up to you.



Here's an example of how to arrange the storage:

class MouseRptParser : public MouseReportParser
{
    private:
        int dx[10];
        int dy[10];
        int dpos = 0;

    protected:
        void OnMouseMove (MOUSEINFO *mi) {
            dx[dpos] = mi-&gt;dX;
            dy[dpos] = mi-&gt;dY;
            dpos++;

            if (dpos == 10) {
                dpos = 0;
                for (int i = 0; i &lt; 10; i++) {
                    Serial.print("X");
                    Serial.print(dx[i]);
                    Serial.print("Y");
                    Serial.print(dy[i]);
                }
                Serial.println();
            }
        }
};


What that gives you is a pair of 10-entry arrays, one for X and one for Y values. Each time a report arrives the current DX and DY values are stored. The pointer for where to store is incremented.  Then, if that pointer equals 10, reset it to 0 and print all the values.

I chose a format that gives you:

X3Y-2X2Y-4X6Y8X-3Y7X6Y38X176Y76X-4Y8X8Y3X39Y-32X71Y4


That is, an "X" followed by a decimal value for a change in X, and a Y followed by a decimal value for a change in Y. The whole lot is then terminated by a standard CR/LF line ending pair.