Microsoft DirectX 8.1 (Visual Basic)

Immediate Mouse Data

To retrieve the current state of the mouse, call DirectInputDevice8.GetDeviceStateMouse or DirectInputDevice8.GetDeviceStateMouse2, passing in a DIMOUSESTATE or DIMOUSESTATE2 type. The mouse state returned in the type includes axis data and the state of each of the buttons.

The x, y, and z members of the DIMOUSESTATE and DIMOUSESTATE2 types hold the axis coordinates. (See Interpreting Mouse Axis Data.) The buttons member is an array of bytes, one for each button. The first element in the array is generally the left button, the second is the right button, the third is the middle button. The high bit is set if the button is down, and it is clear if the button is up or not present.

See also

Buffered and Immediate Data