processing two mouse events - is this possible?

Started by
11 comments, last by Evil Steve 14 years, 2 months ago
Missed that some how; thanks for the correction.
Advertisement
Quote:Original post by neodasan
Quote:Original post by iMalc
As per that page, it's the "signed relative motion or absolute motion, depending on the value of usFlags", for one of your mice. I imagine you get packets that correspond to both mice and something in each packet tells you which one it came from.

You seem to be posting stuff in disbelief without actually trying it. I will tell you now, that raw input is made to allow this and there would be nothing else on Windows that will. So what are you waiting for? Start using it!


Thanks, iMalc! No I've already tried RAW MOUSE INPUT stuffs. Just not sure what its lLastX and lLastY values are exactly and how I should make use of them to measure two different mouse movements. That's my question.

Those values contain either relative or absolute mouse coordinates. You can tell which kind they are by looking at the flags part of the RAWMOUSE structure. (You have read the MSDN docs, right? :])

You differentiate which mouse is giving this motion by looking at the hDevice member of RAWINPUTHEADER, which is the RAWINPUTs you get in the WM_INPUT raw input handler.

EDIT: If you mean you need to know how to the "when the cursor has moved 1000 pixels in a given direction" bit you mentioned in your OP, you'll need to store a start coordinate, and calculate the distance from the current mouse position on each mouse update. If it's >= 1000px, perform your action.
Quote:Original post by mattd
EDIT: If you mean you need to know how to the "when the cursor has moved 1000 pixels in a given direction" bit you mentioned in your OP, you'll need to store a start coordinate, and calculate the distance from the current mouse position on each mouse update. If it's >= 1000px, perform your action.
Raw input from mice is in device units rather than pixels, so you'll also need some sort of mouse sensitivity setting to convert from mouse units to pixels.

Also note that raw input is unfiltered and does not have pointer ballistics applied to it, so the mouse pointer may feel "heavy" (E.g. Unreal Tournament 2004's UI uses raw input (through DirectInput) and feels awful).

What exactly are you trying to use multiple mice for?

This topic is closed to new replies.

Advertisement