Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Weird keyboard buffer overflow

This thread is locked; no one can reply to it. rss feed Print
Weird keyboard buffer overflow
CascoOscuro
Member #4,966
August 2004
avatar

Hi.
Maybe the solution to this problem is using polling, but at first i shouldn't had to do this.
Keyboard buffer overflows depend of the keys pressed. For example, being <-,->,<b>/|</b> and \|/ the arrow keys, -> + <b>/|</b> + SPACE doesn't have problems, but <- + <b>/|</b> + SPACE makes keyboard buffer oferflowed.
My question is, why? And, there is a way to solve this without polling? Maybe just a technical issue of the internal key decodifier, but as i remember i don't experimented this problem under Linux (or maybe i haven't tried it).

X-G
Member #856
December 2000
avatar

Quote:

...makes keyboard buffer what you know.

Can we have that in English?

If you mean the beepy thing, it's because of keyboards are wired. You can't reliably push any three buttons at once and have it work. This only works with some combinations (like Ctrl-Alt-Del).

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Evert
Member #794
November 2000
avatar

Quote:

Maybe the solution to this problem is using polling

I'm not clear on what the problem is, but this certainly won't solve it.

Gideon Weems
Member #3,925
October 2003

Have you tried doing the same key combination elsewhere? Try it right now; I bet you'll get beeps. Maybe I also misunderstand, though.

CascoOscuro
Member #4,966
August 2004
avatar

The same combination beeps elsewhere in Windows.
It's not harder to find games that in certain moments requires three keys pressed. For example, fight games such as SF or Mortal Kombat.
For the game i'm making it's need for fire aiming. For now, i've changed the default keys, but the capability of configuring keys makes the risk.
The best solution is implementing a joystick method, but obviously it works for people who have a joystick or pad.
Thanks all for your help.

miran
Member #2,407
June 2002

Not all keyboards are the same. What you're describing if I understand you correctly (it's hard though, because your English is less than good :P) happens a lot on the cheapest keyboards, but on the better and more expensive ones you can expect to be able to press any key simutaneously with at least any 3 or 4 or even 5 other keys...

--
sig used to be here

CascoOscuro
Member #4,966
August 2004
avatar

Quote:

(it's hard though, because your English is less than good :P

I admit that i didn't explain very well the problem, sorry :).
And i admit that my keyboard has more than 5 years old ;D. Why should i buy a new one if it works fine?
So I can assume that most of the people have a modern keyboard.

Richard Phipps
Member #1,632
November 2001
avatar

Since keyboards are cheap now and this problem is due to a hardware design you cannot do anything about, I think it's safe to carry on as you are.

X-G
Member #856
December 2000
avatar

I can press up to four simultaneously, but it depends on the keys. PUIO I can press without a problem, but not VBNM. JKL works, but HJK doesn't.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

miran
Member #2,407
June 2002

Quote:

So I can assume that most of the people have a modern keyboard.

I think nowadays most keyboards are pure crap. Back in the old times they used to make proper keyboards, I still have one from 1995 (can't use it though because of the connectors) and it can do combinations of 4, 5 and 6 keys, in some cases even more. All the newer ones can do only 3 or 4, rarely 5. Probably those slightly more expensive ones are better, but most people aren't prepared to pay 50-100€ for a keyboard when the can get one for <10€ and it's those that are the crappy ones...

EDIT: When I'm talking about combinations of keys, I mean keys that are physically close together, of course...

--
sig used to be here

Oscar Giner
Member #2,207
April 2002
avatar

It happens with modderns keyboards. I don't think any standard keyboard tries to solve it, because it would make it quite expensive. Maybe there are "gamers keyboards", but I don't know why anyone would want that (if they exist) instead of a gamepad.

Evert
Member #794
November 2000
avatar

Quote:

I still have one from 1995 (can't use it though because of the connectors)

So do I. When I bought a new computer, I bought a converter so that I could continue to use my old keyboard... I love it! They don't make keyboards with white and grey keys anymore, it seems... let alone keyboards that have no Windows key ;D

Quote:

Maybe there are "gamers keyboards", but I don't know why anyone would want that (if they exist) instead of a gamepad.

There are. Check out Blizzard's online store for a World of Warcraft keyboard. Not sure what;s special about it otherwise... maybe it has shortkeys for actions in the game.

Anyway, a keyboard is not a gamepad. The only keys you can reliably press down at the same time are the modifier keys (ctrl, shift, alt, win). Either allow your user to change his keyboard configuration so that he can pick keys that he can press at the same time, or design your game in such a way that it's not nescessary to press more than two keys at the same time. I always get annoyed when I find a game requires me to put my hands in an awkward position because it wants me to hit several keys simultaneously.

Go to: