Pullin gmy hair out...

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Pullin gmy hair out...

Post by r00k »

So, I've switched from MSVC 6.0 to MSVC 2005, basically had to create a clean setup. But now, when I alt-tab my mouse pointer is stuck in the bottom right corner of the screen! Eek! I've used a DIFF program to compare changes I might have made but nothing really jumps out at me. I'm pretty sure im using a newer DirectX sdk when installing 2005. Any suggestions, as my head really is starting to hurt from banging it on the desk! :(
MauveBib
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Post by MauveBib »

switch back?
Apathy Now!
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Pullin gmy hair out...

Post by Baker »

r00k wrote:So, I've switched from MSVC 6.0 to MSVC 2005, basically had to create a clean setup. But now, when I alt-tab my mouse pointer is stuck in the bottom right corner of the screen! Eek! I've used a DIFF program to compare changes I might have made but nothing really jumps out at me. I'm pretty sure im using a newer DirectX sdk when installing 2005. Any suggestions, as my head really is starting to hurt from banging it on the desk! :(
In Qrack?

I've had this problem on the current build of Qrack on my Windows XP machine.

If I am correct, here is what is doing this ...

1) You are either using dinput or not using dinput, I bet. What I mean is that you are using the opposite input method of what you usually use.

2) There are 2 sets of code to release the mouse when app deactivate occurs in vid_wgl.c, the dinput way and the non-dinput way. And other extra factors like whether or not the mouse is windowed and whether or not _windowed_mouse = 1.

Some where in one of those sets of conditions, something is amiss.

There is some code that locks the mouse to window. If I recall this is different than the code that constantly moves the mouse to the center of the window.

I remember battling with this a year ago and the end result was me rewriting all the in_win.c code just so I had total understanding of each and every single item that was going on.

I'd recommend adding Con_Printf("Mouse was released\n ..."); and so forth if developer >= 10. Somewhere something is not getting triggered.

This represents a guess, but I am pretty sure I've had the mouse cursor locked to the window in Qrack 1.90 on Windows XP in windowed mode when it shouldn't be.
Last edited by Baker on Tue Jan 13, 2009 9:19 pm, edited 1 time in total.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Post by r00k »

Hehe, okay i've tracked it down :P (pasting my hair back over the bald spots...)

It seems that it was a cfg problem and quite possibly a new bug i need to address. When a user has m_directinput 0 this problem occurs, as with m_directinput 1 it's perfectly fine! :O Yippy I love spending 3 hours of self abuse to track down bugs :P

EDIT: :P Baker replied as i was typing this message :D
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

Alt-tab from Quake?

If you're using DirectInput it automatically hands the mouse back to the OS when the app loses focus, unless you've got a DISCL_BACKGROUND co-operative level set (in which case you may not be unacquiring the device on a focus switch). If it's software input the code to re-center the pointer on-screen may have gone wacko on you.

Checking out your 1.90 source you haven't changed anything in your SetCoperativeLevel call.

I'm on the March 2008 SDK, and don't have this problem, but DirectInput hasn't been updated since version 8, so I doubt if I'm any different to you.

Edit: 2 replies while I was typing this!

By the way, you can get rid of the move-mouse-to-center-screen code when using DirectInput. ;)
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Post by r00k »

mh wrote:
By the way, you can get rid of the move-mouse-to-center-screen code when using DirectInput. ;)
Hehe, I was just looking at that part....

Code: Select all

// if the mouse has moved, force it to the center, so there's room to move
	if (mx || my)
		SetCursorPos (window_center_x, window_center_y);
Post Reply