Q3/SC and how they use the mouse

Started by
5 comments, last by IceGod 22 years, 8 months ago
In Q3, if you increase your sensitivity inside windows the mouse movement in q3 increases accordingly. Its the same in sc. Also if you have acceleration on acceleration will occur in q2 and sc too. However it appears both of those applications use exclusive mode for DirectInput, so supposedly the mouse shouldn't respond to settings inside windows. If I mess with my mouse settings the DirectInput sample program "Scrawl" always has the same speed, so there must be something SC and Q3 do to respond to settings inside windows. So what do they do, or am I missing something? Tom Edited by - IceGod on August 5, 2001 5:33:54 AM
Advertisement
They may not be using DirectInput to grab mouse movements. A lot of games use the standard Windows system to filter mouse movements because of the strange way DI handles it.

The ''exclusive'' mode mearly pertains to other programs running at the same time also using DI. In non-exclusive mode all DI programs receive the input.
Well, when you start Q3 it says initializing DirectInput, so it makes me assume that its using DInput for the mouse... I guess it could be using windows messages, I''d have to check. So does anyone know of a way to do what Q3 does with DInput?

Tom
I''d imagine keyboard and joystick input. You don''t *have* to init the mouse part if you don''t want too.
Or maybe they can "read" the settings in windows and adjust their movement(dinput) according to those settings.

But that seems far fetched...
-------------Ban KalvinB !
I''d say they use DirectInput for keyboard/joystick and normal windows stuff for mouse. That''s not to say the use messages (actually, it''s quite unlikely they use messages, since I think, but I''m not sure, that mouse messages are fairly low priority. That means they can be kicked off the message queue if higher priority messages arrive first (eg WM_PAINT). You can use the GetCursorPos() to get the cursor position at any time.

That''s how I use the mouse in my game, and it works a treat, since not only can I take advantage of the user''s windows settings for free, but I also get cool animated cursors for free! Also, if the framerate drops (which happens when I''m loading a new level for example) the mouse still moves at full speed, which makes things a little easier for the user. The final benefit of using GetCursorPos() for the mouse, is that it works flawlessly in windowed mode - that is, the mouse isn''t "caught" inside the game window, I can move it in and out as I go into the debugger and whatever.

War Worlds - A 3D Real-Time Strategy game in development.
I was just messin around in q3, and I changed my sensitivity in windows and went to check it in q3. To my surprise, the settings inside q3 didn''t change at all.. So it looks like q3 is using DirectInput for mouse input. However I''m positive that quake 2 used to respond to changes made inside windows, so they must have been doing something similar to what Dean Harding said (using GetCursor pos or some other windows functions). So thats cool, good stuff to know... I wonder why q3 changed to DirectInput though, I guess so that you could stick your settings in and always have the same result regardless of windows settings. Anyhow, thanks for the replies guys.

Tom

This topic is closed to new replies.

Advertisement