Think about it.
You have a loop which polls the mouse events once every iteration.
When there was a mouse movement, you set the "new" mouse coordinates to the corresponding coordinates given by the callback arguments. In addition, you also have "old" mouse coordinates stored in class fields.
What do you need to do in order for the difference between "new" and "old" coordinates to be the delta only in the current loop iteration and zero in the next?