OK, I have some of what you want. I loaded an image in the background so I can see my x and y positions display.... all I am checking is y position of the mouse. you can also add code to check x position in addition.
I spent some time spinning my wheels trying to understand why my x and y positions just overwrote, and did not clear then write. I decided to put an image on the background to cause a redraw which helped see my 'debug' statements....
I am pretty good at c/c++, but a noob at DGSDK
Hope this helps. Happy holidays and I am off to family to stuff my self sick