Inside3D!
     

Can't stop spinning
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
dreadlorde



Joined: 24 Nov 2009
Posts: 86

PostPosted: Sat Feb 06, 2010 10:18 pm    Post subject: Reply with quote

The spinning only happens when I have forward, backward, left, right, strafe left, strafe right bound to keys that are letters. The spinning doesn't happen if I use the arrow keys..

Shocked
_________________
Ken Thompson wrote:
One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
Back to top
View user's profile Send private message AIM Address
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sun Feb 07, 2010 1:05 am    Post subject: Reply with quote

A good read ...

http://forums.inside3d.com/viewtopic.php?t=1257

Possibly related to your problem. If you are exiting and entering the focus of the Quake window, it is possible that Quake stupidly is doing a Keyup simulated keypress for every key on your keyboard.

It does on Windows, leading to annoying results on ALT-TAB.

If you really want to find out fast do this in config.cfg

alias +testkeys "say my key has been pressed"
alias -testkeys "say my key has been released"
bind x +testkeys

If you see "my key has been released" print in the console when you never even pressed the key, doing the tutorial linked in this post may very well solve your problems.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
dreadlorde



Joined: 24 Nov 2009
Posts: 86

PostPosted: Sun Feb 07, 2010 1:52 pm    Post subject: Reply with quote

The message never showed up. Sad
_________________
Ken Thompson wrote:
One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
Back to top
View user's profile Send private message AIM Address
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sun Feb 07, 2010 2:06 pm    Post subject: Reply with quote

dreadlorde wrote:
The spinning only happens when I have forward, backward, left, right, strafe left, strafe right bound to keys that are letters. The spinning doesn't happen if I use the arrow keys..

Shocked


dreadlorde wrote:
The message never showed up. Sad


Ok, but this still is enough information that you should be able to do some debug catching.

You are saying that the spinning is related to keypresses because of the top quote.

All keypresses flow through the Key_Event handler. Certainly you put some Con_Printfs in there to print to the console when that gets called.

Like Con_Printf("Key_Event ... key = %i", mykey); or whatever.

Whenever a situation has "only happens when" you have enough information to trap the problem and get more information about why it is happening.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
dreadlorde



Joined: 24 Nov 2009
Posts: 86

PostPosted: Sat Aug 14, 2010 10:10 pm    Post subject: Reply with quote

So I've learned more C, more about the engine and I've read Baker's ``Fixing annoying -alias keypress in standard Quake'' tutorial. But I'm still not sure where to call Key_ClearStates from. The Key_ClearStates I'm using is the same as Baker's version:
Code:

void
Key_ClearStates(void) {
    int i;

    for(i = 0; i < 256; i++)
        if(keydown[i])
            Key_Event(i, false);
}
I currently call this from the end of vid_x.c:/^XLateKey/, which fixes my original problem, but now if I start walking and turn, I stop moving altogether. I'm almost certain this has to do with where Key_ClearStates is being called. I think I'll try calling it from vid_x.c:/^GetEvent/, and see how that works.
_________________
Ken Thompson wrote:
One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
Back to top
View user's profile Send private message AIM Address
dreadlorde



Joined: 24 Nov 2009
Posts: 86

PostPosted: Sun Aug 15, 2010 4:09 am    Post subject: Reply with quote

Calling Key_ClearStates() from cl_input:/^CL_ParseServerInfo/, right after the call to CL_ClearState() seems to fix the issue.

Very Happy
_________________
Ken Thompson wrote:
One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
Back to top
View user's profile Send private message AIM Address
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sun Aug 15, 2010 10:37 am    Post subject: Reply with quote

dreadlorde wrote:
Calling Key_ClearStates() from cl_input:/^CL_ParseServerInfo/, right after the call to CL_ClearState() seems to fix the issue.

Very Happy


Cool.

I wish I had a dedicated Linux machine. Had my Linux machine not gotten broke, ProQuake Linux would be entirely Windows equivalent in functionality. In fact, at the time my Linux machine broke I was ramping up revision after revision after revision.

Oh well ... eventually I'll have a dedicated Linux machine again. Virtual Box just doesn't cut it and I don't have a good candidate machine for dual booting.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group