Archived

This topic is now archived and is closed to further replies.

ed091maf

DirectInput problem

Recommended Posts

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

Share this post


Link to post
Share on other sites
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-

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites