Pages: [1]
  Print  
Author Topic: keyboard problem, key pressed but does not have an effect  (Read 18673 times)
dash9
Member


Cakes 6
Posts: 189


« on: September 25, 2008, 06:29:50 PM »

Did it ever happen to you to find yourself pressing one of the wasd keys without the character making steps in that direction? It happened to me only one time, in 0.8. I doubt it's a hardware problem, the keyboard is pretty capable. If I repress the key, it works normally. I use Ubuntu Hardy 64.
Logged

I found a great camping place: the enemy base!
fufinha
stop making alt accounts and self-termination
Member


Cakes 7
Posts: 584


retired


« Reply #1 on: September 25, 2008, 10:40:57 PM »

I get something like that on q3 and no doubt OA. It happens when the system doesn't respond and the key doesn't toggle off. I'll take a guess and say it happens when I do alt-enter while pressing a key in. I have never considered it a bug or anything that's been a problem. It only happens rarely and I just press the key again then it resets. I  don't know if it's the same issue though.
Logged
andrewj
Member


Cakes 24
Posts: 584



« Reply #2 on: September 26, 2008, 03:47:42 AM »

Maybe you were pressing other keys at the time?
Keyboards often cannot handle 3 normal keys pressed and never more than 4
[excluding the SHIFT/CTRL/ALT keys which have their own circuit].

I very regularly had the opposite problem, my character stopping moving
forward (or sideways) even though I was still holding the key down (and not
pressing any others).  I now think it was caused by the screensaver (Ubuntu)
temporarily starting up, getting the focus (hence the original app loses
keyboard focus) and then it notices a mouse move and goes away again.
Logged
kernel panic
Lesser Nub


Cakes 6
Posts: 114


« Reply #3 on: September 26, 2008, 04:49:44 AM »

Quote
Maybe you were pressing other keys at the time?
Keyboards often cannot handle 3 normal keys pressed and never more than 4
[excluding the SHIFT/CTRL/ALT keys which have their own circuit].

That could be it. I, for instance, can't strafe backwards for the keyboard doesn't take the jump action if I'm already pressing backpedal and strafe. For some reason it doesn't happen if I strafe forward. I read a post in some debian mailing list time ago about exactly the same thing regarding Q3 and derivatives games.
Logged
andrewj
Member


Cakes 24
Posts: 584



« Reply #4 on: September 26, 2008, 07:04:51 AM »

I, for instance, can't strafe backwards for the keyboard doesn't take the jump action if I'm already pressing backpedal and strafe.
Me neither, S +D + SPACE just doesn't work.
It is not the game's fault, the keyboard itself cannot handle that combination of keys
(and many other combinations of three keys).
Logged
fufinha
stop making alt accounts and self-termination
Member


Cakes 7
Posts: 584


retired


« Reply #5 on: September 26, 2008, 10:50:03 AM »

Andrews comment about the window focus also makes sense, it happens when my virus checker comes on in mid game - it's a pain in the arse. The screen goes dark which is a sign something has started up in the background. I've never paid much attention to it as I've always known it's something I've done that's caused it / or some auto update.

I guess the 3 key thing affects linux users. I have never had that issue.. only the key pressed in issue where you can be standing there shooting the wall looking very stupid Cheesy
« Last Edit: September 26, 2008, 10:51:36 AM by missbehaving » Logged
damocles
Bigger member


Cakes 0
Posts: 158


May cause drowsiness


« Reply #6 on: September 26, 2008, 10:59:20 AM »

Off-topic, but I used to have problems with old (5-pin AT) keyboards not recognizing more than 2 or 3 keys at a time (like DOOM or ROTT or Duke3D without the mouse, Shift + Alt + Left + Forward would not fully work).  A newer keyboard "solved" this.

(But, if this is a get-rid-of-legacy-support regression in USB keyboards, that's very disappointing.  (Everyone uses OpenGL now.))


Note that I've heard someone getting maybe 6 simultaneous keys with DirectInput on Wine, and I've just tried Alt+Ctrl+Down+Kp_Ins+G in 0.8.0 Linux (very impractical in an actual game Smiley), so YMMV.  (OTOH, only certain combinations of 3 or 4 letters worked for WM input (not DirectInput) in Windows and Wine, but this wasn't for a game.)
« Last Edit: September 26, 2008, 11:01:09 AM by damocles » Logged
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #7 on: September 26, 2008, 11:00:59 AM »

For an explanation about the hardware limit head "Keyboards are evil!" (http://www.sjbaker.org/wiki/index.php?title=Keyboards_Are_Evil)

The engine does not read the state of the keys but currently relies on key-events. So if the game missed a key-up event it will consider the key to remain pressed till you press and release it again and also the other way around. This can be caused by external factors as missbehaving said or en event queue overflow (very unlikely). I created some protection against event queue overflow in Open Arena 0.7.6 but removed it later. The game should be able to handle 10000+ events per second with the current input system if you have a decent framerate.
Logged

There are nothing offending in my posts.
fufinha
stop making alt accounts and self-termination
Member


Cakes 7
Posts: 584


retired


« Reply #8 on: September 26, 2008, 11:26:19 AM »

I just checked on defrag and the two key thing is right enough. If you press another key then it responds and the first key pressed toggles off.

Fire, jump etc will all work together with the 2 keys as stated above. And no, I wasnt tempted to photoshop the pic and ask Andrew to explain it hehe.

Logged
menganito
Lesser Nub


Cakes 7
Posts: 119


« Reply #9 on: September 26, 2008, 01:32:22 PM »

Used to ahppen t o me in other games in Windows, I never encountered it on Linux, tho. Maybe because I jump with right mouse button Cheesy so backward strafejumping is no problem Smiley
Logged
dash9
Member


Cakes 6
Posts: 189


« Reply #10 on: September 26, 2008, 06:52:33 PM »

I guess the 3 key thing affects linux users. I have never had that issue.. only the key pressed in issue where you can be standing there shooting the wall looking very stupid Cheesy
The "3 key thing" aka "ghosting" is caused by cheap keyboards. (Try pressing at the same time e, c and then u and you'll notice the third press will have no effect.) So when a gaming keyboard sais it has anti-ghosting it means you can press more keys at the same time and all the key press and key depress events are generated as they should.

Unfortunately it happened again today, once.

So the problem in my case is somewhere in the linux64-sdl-openarena chain, I'm also having in mind the character-looking-down problem I reported (which seems to happen only when I move the mouse).
Logged

I found a great camping place: the enemy base!
fufinha
stop making alt accounts and self-termination
Member


Cakes 7
Posts: 584


retired


« Reply #11 on: September 26, 2008, 08:40:35 PM »

I have had many keyboards and most if not all are probably cheap crap.

To be honest, I've never had a 'gaming mouse' nor 'gaming keyboard', if it may help me win games then it could be a sound investment Cheesy
Logged
andrewj
Member


Cakes 24
Posts: 584



« Reply #12 on: September 26, 2008, 08:57:33 PM »

The engine does not read the state of the keys but currently relies on key-events. So if the game missed a key-up event it will consider the key to remain pressed till you press and release it again and also the other way around.
There is no real "state of the keys", as the keyboard itself sends event codes to the motherboard for the operating system to read.  The game engine is not really to blame if the next layer up (windowing system or OS) doesn't give it all the keyboard events.

Of course the (io)Quake3 logic for key handling may have bugs in it, I've followed the code from getting the key event from SDL all the way to controlling the player.  The logic for turning a "button" (like forward) on or off is actually quite complicated, though I couldn't spot any bug.  Perhaps the only way to really get to the bottom is to add debugging printfs (for key events got from SDL and then button on/off status) and look for the anomaly.  Also: try disabling the screensaver!

Logged
fufinha
stop making alt accounts and self-termination
Member


Cakes 7
Posts: 584


retired


« Reply #13 on: September 27, 2008, 05:58:11 AM »

dash9, you should try defrag and see if you notice any difference in the control. In the CHS menu (crosshair view) you can asign endless parameters to be viewed on screen. No matter what keys I pressed, I could not get 3 directional keys to display under any conditions. However the game seems  efficient at responding to 'new' events so I think using a gaming keyboard may do worse than good.

I have no idea why the antighosting stuff would have any advantage. I think sago is trying to explain in simple terms when the game recognises a condition of the keys, like +attack / -attack which is a toggled when the key is pressed/released.  Other functions like weapon changes do not have any need for +/- behaviour.

With WASD keys then the game seems to accept W and S being used with a directional key and you can swap direction and the other direction key is toggled off. If you try a combination that isn't logical, like pressing forward and back at the same time you will stop dead. It makes no sense. That is only two keys which even a cheap keyboard can manage.

When you are strafing I guess the first key pressed is the forward key, which can even be your 'A' key. You will strafe sideways but still use the same combination of keys. Easiest way to explain this is to think of the keyboard sideways so that A is your front key and W is your right key. S = left etc. You will move just as fast moving sideways as you can forward. Again, if you press A then hit D then I bet they will both be toggled off because you cant move in two directions at the same time. I think thats where the game has it's own logic.

I also use right mouse button for jump, but space bar works fine too.

Other factors could be a complete loss of fps, if you set maxfps to 1 'or' press alt/enter (minimise mode) when jumping into the void spots then you can land on the floor of many maps where you should have died.

unlagged has several bugs too affecting movement, this has some strange affects at times. If you do in_restart after changing unlagged settings and you will find strange behaviour to movement. If you look at configs being used by players using unlagged 2.01 you will see they are using very low sensitivity when using hitscan. There is a big difference in mouse behaviour and just to make it more complex this has nothing to do with any SDL change

 Have you checked the logs to see if theres anything graphical being updated in the background?  screensaver? Cheesy

Logged
Mr. Grey
Nub


Cakes 0
Posts: 7



« Reply #14 on: July 10, 2010, 10:51:42 AM »

I dont want to open a new topic so i write it here.
I have the problem, that pressing shift has no effect. I can't write in capital letters or use smilies in ingame chat or in the console, shift does not work. I dont know, but could it have something to do with the sdl-library? And as you can see, my shift key works pretty fine outside of OA.
« Last Edit: July 11, 2010, 11:39:51 AM by Mr. Grey » Logged
Pages: [1]
  Print  
 
Jump to: