Game Design, Programming and running a one-man games business…

Dealing with mice

Take a trip far back in time when dinosaurs ruled the earth and Directx 5 was the very latest cutting edge thing. Back then, the hip cool and trendy thing to do with mouse input was to use direct input. I have a pile of programming books on how to do it, and you can enjoy the handy tutorials on capturing mouse input using directinput in the directx9 (and later) SDKs.

But…

It turns out that this is not the way to do it. In fact, there are even articles online now where Microsoft quietly admits that if all you want to do is normal mouse input, you should avoid directinput altogether. To make things worse, there are a ton of features to do with mouse acceleration, button swapping, double click speeds blah blah, that are all missing and need to be implemented from scratch (as I was doing….mostly)  if you use directinput for the mouse. How come I missed the memo on this?

Like a trusty old coder, I’ve been re-using my engine for a while, and although I have a nice shiny new graphics engine I was still using directinput for the mouse, which explains the somewhat erratic and crap mouse support in GSB. But that changed today, when I finally got sick of it, and ripped it out. The next patch will switch GSB to the standard windows cursor, even in fullscreen, and it will all work much better.

One day I’ll find time to sort out the keyboard too…


7 thoughts on Dealing with mice

  1. Did you run it in mostly in windowed mode while developing? The current full screen mouse sluggishness is indeed very annoying.

  2. I haven’t noticed any mouse problems, but I want to know. What is the difference between these two methods(other than one is the one windows uses)?

  3. Apparently mouse acceleration is old school, and mouse ‘ballistics’ is what xp and vista do, which is way better and more complex.
    Using GetCursorPos() and the mouse messages traps all this and its just like windows. Using directinput stuff doesn’t.
    Feel free to correct me, if anyone knows different.

  4. Thank god! The mouse always felt really weird in fullscreen and it bugged me. Same thing i Democracy 2 if I recall correctly. Nice to hear that you’ll fix it.

  5. Wow thank you so much! I can’t even play the game in it’s current state, the mouse is so sluggish and makes it very hard to quickly and accurately click on something on screen.

    Windowed mode doesn’t work for me because my max resolution is 1360×768 on my 40 inch monitor and I can’t get any resolutions smaller than that in the game, even with the taskbar hidden I still have the title bar of the game that pushes the game window too low, and in W7 it’s not possible to move windows up so the titlebar is offscreen…

Comments are currently closed.