How to read raw mouse data in v.7 (time-tagged relative position at highest rate and resolution)?

 How to read raw mouse data in v.7 (time tagged relative position at highest rate and resolution)?

I would like to use the innards of an optical mouse (Microsoft BlueTrack) to sense the surface velocity of an arbitrarily-rotating sphere by feeding the x and y relative position changes (along with accurate sample times) directly into Mathematica 7.

The v.7 MousePosition function is confined to the cell/window/screen coordinates and does not seem to allow for unbounded motion, or the removal of any mouse driver filtering.

I probably need to use the Windows user32.dll functions for reading raw mouse data —

Raw Input:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645536(v=vs.85).aspx

RAWMOUSE structure:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645578(v=vs.85).aspx

– where my primary interest is in the lLastX and lLastY values (with signed relative motion selected by usFlags), along with the sample times, but I don’t have the C++/# programming chops to make this work.

Can anyone show me, with sample code, how to access these values in real-time from Mathematica 7?

Let’s block ads! (Why?)

Recent Questions – Mathematica Stack Exchange