Direct Input 8

The Mouse

The sample includes code for the mouse. Setup for the mouse is very similar to the key board. There are two dataformat types for the mouse: c_dfDIMouse and c_dfDIMouse2

c_dfDIMouse returns a DIMOUSESTATE structure which has 4 bytes for button states.

c_dfDIMouse2 returns a DIMOUSESTATE2 structure that has 8 bytes for button states.

In both the immediate and buffer mode the GetDeviceState initializes these structures.

hr = g_pMouse->GetDeviceState( sizeof(DIMOUSESTATE2), &dims2 );

You might also like...

Comments

About the author

David Nishimoto United States

NishiSoft provides Part I of the Information Technology Project collaboration. Sign up and list your IT project tasks, assign task too friends, and get percent complete task.

Part will ...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill