Game Development Community

Certain key combinations not working

by USC - IMD student 5 · in Torque Game Builder · 11/07/2007 (11:09 am) · 4 replies

I use 2 behaviors taken from the Garagegames website AsteroidControls.cs and shoots.cs

In AsteroidControls.cs, I use the following code:

%template.addBehaviorField(upKey, "Key to bind to acceleration", keybind, "keyboard up");
   %template.addBehaviorField(leftKey, "Key to bind to rotate left", keybind, "keyboard left");

In shoots.cs, I use the following code:

%template.addBehaviorField(fireKey, "The key to fire the projectile with", keybind, "keyboard space");

However, if I hold down Up, then Left, then Fire, the first two keys will register making my avatar go around in a circular motion, but he will not fire.
If I hold it down in a different order, only the first 2 keys register and the third key is ignored. This problem arises with LEFT, UP, and SPACE used in combination specifically i.e. if I hold down LEFT, DOWN (instead of UP), and SPACE all three keys register and I go around in a circle firing stuff.

This problem also arises for certain combinations of keys like UP, LEFT, G and DOWN, RIGHT, NUMPAD0.

Does anyone know how to fix this and allow all three keys to be register when held down simultaneously?

#1
11/07/2007 (9:35 pm)
I happened to experience the same quite awhile ago... and since i really didnt find a solution for that, i just decided to remap the fire key to the standard for today's STGs ... the Z key.
#2
11/08/2007 (1:32 am)
Yes, I have found this problem also. As well as the SPACE key not registering on some Mac machines. Needless to say, it is frustrating.
#3
11/09/2007 (2:18 am)
I have also experienced this issue ... UP + RIGHT + SPACE (fire). The RIGHT arrow was causing the issue for me. I remapped the keys and it works fine. I agree, it is frustrating.
#4
11/09/2007 (2:51 am)
The problem is with some keyboards if I recall rightly. Some keyboards do not have the capability to register more than 2 keys at once (which isn't needed really when typing. I guess the shift-alt-ctrl-altGr keys are treated as one 'modifier' together). This is hardware related, and you can't know what type of system your players will have.

Correct me if I'm wrong

David

---
Nebulagame Development Site
D-log