Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectInput problem

Started by ed091maf Apr 7, 2000 at 12:15 PM 3 replies 550+ views
Original Post
ed091maf
ed091maf
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
Cygon
Cygon
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.
Ridcully
Ridcully
haha, that''s a nice smiley you got there in your pseudocode...
ColdfireV
ColdfireV
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]
Melo
Melo
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.