pressing many keys at the same time

Posted By: ventilator

pressing many keys at the same time - 04/01/03 01:44

i am working on a two player game with the players at the same computer. if one player presses too much keys at the same time to control his entity the other player gets problems controlling his entity because some keys don't react properly anymore. is there a (directinput or engine) limit of how many keys can be pressed at the same time? how could i workaround or avoid this? i think it happens when more than 4 keys of the keyboard get pressed at the same time. i tried to do my steering code with different methods (on_..., key_pressed(scancode),...) but nothing helped...
Posted By: Error014

Re: pressing many keys at the same time - 04/01/03 02:52

I read about it in a readme for a game, don't know which (No GameStudio-Game!). In this readme it said, this is a problem with the keyboard-driver, and they "working hard to solve this problem"

So, I see only the solution that one player plays with joystick.
Posted By: Doug

Re: pressing many keys at the same time - 04/01/03 04:22

I think this should be in the FAQ (please post follow up questions there).

This is a keyboard hardware problem and not a software or driver problem. I will not go into the details, but your keyboard keys are not individually mapped, they use a matrix of wires with each key acting as a switch. If you press the right (wrong) combination of keys you can ‘block’ other keys from responding.

To see this in action, open up notepad, press and hold the 'a' and 'w' keys, and then tap the 's' key. On my keyboard the input stops when the ‘s’ key is pressed.

To make things worse, different keyboards can act differently.
Posted By: ventilator

Re: pressing many keys at the same time - 04/01/03 04:58

ok, thank you both for the answers!

i tried to do a spacewar remake and it was almost finished when i found out that the controls don't work properly when 2 players play seriously. [Frown] the strange thing is that pressing all the keys worked with the old spacewar for dos from the eighties. maybe keyboards were designed differently 15 years ago? [Smile]

quote:
To make things worse, different keyboards can act differently.
is there a minimum number of simultanously pressed keys that is surely supported with every keyboard so that i can design controls of future games with that in mind? are there any rules known by experienced game developers to follow?

quote:
So, I see only the solution that one player plays with joystick.
a gamepad would be great for spacewar but i (and i think the majority of pc users) don't have one.
Posted By: Anonymous

Re: pressing many keys at the same time - 04/02/03 18:39

I think I've figured out the problem. Studiing the reactions of the keys. I came to this.
Sertain combinations of minimum 3 keys cause the keypad to block. The pattern is:

q---w-t---y
as-as-gh-gh

I think you could avvoid this by using the only keys from the same row or using only 2 key combination from different rows - like in CS:
W - walk foreward S- walk backward A- left D- right W+A - upper left, S+A backwards and left... As it is unusual to press A+W+S at the same time. Another thnig - this problem won't take place if you press key combinations from different columns like: A+F+O or Q+T+J...
Posted By: ventilator

Re: pressing many keys at the same time - 04/10/03 13:24

here is my little unfinished spacewar game whose keyboard controls don't work properly if two players play seriously. but it's fun to destroy your own torpedos with the laser! [Smile] it does almost look like the original dos version...

keys are:
player1:
(on keypad)
1 - shift energy
2 - cloak
3 - shift energy
4 - rotate left
5 - thrust
6 - rotate right
7 - torpedo
8 - hyperspace
9 - laser

player2:
y - shift energy
x - cloak
c - shift energy
a - rotate left
s - thrust
d - rotate right
q - torpedo
w - hyperspace
e - laser

f4 - toggle planet/gravity
Posted By: Anonymous

Re: pressing many keys at the same time - 04/18/03 12:39

My compiler says Runtime.dll is missing!?
Posted By: ventilator

Re: pressing many keys at the same time - 04/18/03 12:47

if you try to run my game? strange!
Posted By: greyplasma

Re: pressing many keys at the same time - 04/18/03 15:34

Works fine on my Pc ....good fun....

I am facing similar keyboard problem, i am making a mortal kombat style fighting game.

If two people play and one guy is holding more than 3 keys pressed the other guy cannot do anything.

Then i played MK4 again and found the same problem. So i don't think there is an immediate solution to this.
Posted By: Doug

Re: pressing many keys at the same time - 04/19/03 03:17

Anybody try two USB game pads? You can buy a USB game pad for $12 and we support 2 joysticks.
Posted By: Tren_Loco

Re: pressing many keys at the same time - 06/14/05 00:44

Today keyboards have a small buffer, making the machine "forget" last keys pressed if the buffer if full. Try to get an old keyboard. I use one, and y can play with 3 friends using 7 keys each (didn't try more). I repeat, Newer keyboards do not support multiple keys pressed.
Posted By: VampireLord

Re: pressing many keys at the same time - 07/04/05 08:31

Yes and older keyboards like let's say ten year old keyboards don't have a buffer at all and just keep beeping at me when trying to do a 360° in GTA San Andreas Thx for the tip about the keyboard logic. When I remapped one of the keys I was able to do it
Posted By: lostclimate

Re: pressing many keys at the same time - 08/12/06 06:42

yeah, it sucks, i have a newer keyboard, and i can hold maybe a couple of letters, and it beeps at me over and over!
Posted By: PHeMoX

Re: pressing many keys at the same time - 08/18/06 22:37

Quote:

yeah, it sucks, i have a newer keyboard, and i can hold maybe a couple of letters, and it beeps at me over and over!




It must have been mentioned already, but older keyboards do not have this problem, maybe try get one cheap somewhere. However you could also go for the 'special gamers' keyboards, it seems those are mapped a bit different, however pressing more than 5 keys at the time will make it beep too. (e.g. the logitec G15).

Cheers
Posted By: Michael_Schwarz

Re: pressing many keys at the same time - 08/19/06 13:37

thats why I use an keyboard from 1980

evenif some people always bother: "OWTFGM YOU HAVE NO WINDOWS KEYY!!!!!1111oneoneone"
Posted By: FBL

Re: pressing many keys at the same time - 08/23/06 19:37

I simply offer the possibility to map the keys where you want. Just find a combination which plays good and you're fine.
Posted By: EX Citer

Re: pressing many keys at the same time - 10/02/06 13:10

I have two usb game pads
Posted By: Gandalf

Re: pressing many keys at the same time - 12/29/06 19:12

another way; try two PSP games pad with parallel port. At present I test with two, if it works with 4 there, I would make a workshop(studio).
Posted By: KojaK

Re: pressing many keys at the same time - 01/20/07 20:49

I just found that any triangle on my keyboard, such as wa-s beeps, while as-d does not. Apparently any triangle beeps.

Try this in your code:
player.move_x = key_w - key_s;
player.turn = key_a - key_d;

See if that makes a difference...
Posted By: EX Citer

Re: pressing many keys at the same time - 02/11/07 13:51

Now I have only 1 USB gamepads... I broke one when playing virtua fighter evolution.

My hint is:
A) Make your game turn based
or B) Use the combination of keys for several actions:
for example: A turn left, S turn right, A&S move straight. There are multiplayer games in the web which work like that. Its fantastic, because they knew that problem but wanted to make a mega multiplayer game playable on one PC. That means, the used for player one keyboard, for player 2 keyboard for player 3 mouse and for player 4 joypad. The controls work like that: key 1 = move left, key 2 = move right, key 1 & 2 jump

That means the player with mouse can walk left when pressing mouse 1 and walk right when pressing mouse 2. When he presses mouse third (some horrible mouses have no third button - so they made the mouse 1 & 2 to jump) he jumps.
Posted By: PHeMoX

Re: pressing many keys at the same time - 02/18/07 15:26

Lol, very clever, eventhough such approaches tend to waste my mouses fast, big button smashing on the mouse you know ... Lag ... a bit more smashing, slightly frustrated, more lag and bang, a broken mouse ...

Cheers
Posted By: v3c7r0n

Re: pressing many keys at the same time - 01/22/09 21:41

There is also a limit to how many simultaneous key presses windows will recognize. Another solution you could use would be letting one player use the mouse for movement. So you could set controls to be something like this:

Mouse player:

Move Mouse up = thrust
Move mouse down = brakes
move mouse left = rotate left
move mouse right = rotate right

LMB = fire laser
RMB = Torpedo

LMB+RMB = Cloak
RMB+MMB = Hyperspace

and so on. You should be able to detect both mouse buttons down at the same time (I know you could with DirectInput), and if not, let player one use the wasd and such, let player 2 use the num pad.
Posted By: Jaxas

Re: pressing many keys at the same time - 01/30/09 09:33

Joystick is the solution, but also you can try usb keyboard, or special gaming keyboard wink sorry,i haven't try them, but they can be solution smile
© 2024 lite-C Forums