View previous topic :: View next topic |
Author |
Message |
dreadlorde

Joined: 24 Nov 2009 Posts: 86
|
Posted: Sat Feb 06, 2010 10:18 pm Post subject: |
|
|
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..
 _________________
Ken Thompson wrote: | One of my most productive days was throwing away 1000 lines of code. |
Get off my lawn! |
|
Back to top |
|
 |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Sun Feb 07, 2010 1:05 am Post subject: |
|
|
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 |
|
 |
dreadlorde

Joined: 24 Nov 2009 Posts: 86
|
Posted: Sun Feb 07, 2010 1:52 pm Post subject: |
|
|
The message never showed up.  _________________
Ken Thompson wrote: | One of my most productive days was throwing away 1000 lines of code. |
Get off my lawn! |
|
Back to top |
|
 |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Sun Feb 07, 2010 2:06 pm Post subject: |
|
|
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..
 |
dreadlorde wrote: | The message never showed up.  |
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 |
|
 |
dreadlorde

Joined: 24 Nov 2009 Posts: 86
|
Posted: Sat Aug 14, 2010 10:10 pm Post subject: |
|
|
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 |
|
 |
dreadlorde

Joined: 24 Nov 2009 Posts: 86
|
Posted: Sun Aug 15, 2010 4:09 am Post subject: |
|
|
Calling Key_ClearStates() from cl_input:/^CL_ParseServerInfo/, right after the call to CL_ClearState() seems to fix the issue.
 _________________
Ken Thompson wrote: | One of my most productive days was throwing away 1000 lines of code. |
Get off my lawn! |
|
Back to top |
|
 |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Sun Aug 15, 2010 10:37 am Post subject: |
|
|
dreadlorde wrote: | Calling Key_ClearStates() from cl_input:/^CL_ParseServerInfo/, right after the call to CL_ClearState() seems to fix the issue.
 |
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 |
|
 |
|