DirectInput problem

Started by
3 comments, last by ed091maf 24 years ago
I decided to use DirectInput for my mouse movement and button state handling. However, when i Acquire() mouse device, the mouse pointer moves very very slowly. Why is it so? Does the movement speed depend on computers speed? Thanks in advance
Ernis
Advertisement
No, the speed of the mouse should have nothing to do with the computer''s speed.

PS/2 mice send their new position regularly to the system (generating an int 33h), so the mouse data is constantly updated.
On the other side, an USB mouse tracks its own movement internally and only sends this data to the system on request.

Try to call DIDevice:oll() before you request the device data, this will force an update on polled devices, and, as written in the docs, is ok to call on other devices not supporting polling.

-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
haha, that''s a nice smiley you got there in your pseudocode...
Just a thought... Are you acquiring the mouse every time you wish to get the mouse data? If you are, you don''t have to. Just acquire it once in the beginning and that''s all. If you''re acquiring it every frame (or however often you ask for the mouse position), it''ll surely make everything run slower. I don''t know how you set it up, but just don''t acquire the mouse often.


ColdfireV
[email=jperegrine@customcall.com]ColdfireV[/email]
DirectInput just returns ordinary Numbers from the driver (called Mickeys). Those values depend on the hardware(-drivers). So if you calculate your new mouse position like so...
newx += dims.lX * MouseSensivity;newy += dims.lY * MouseSensivity; 

...you can give the user the ability, to set the mouse-sensivity, by himself.

Hope this will solve your problem

Ciao! _Melo

This topic is closed to new replies.

Advertisement