Game Development Community

2 keys at a time?

by Goerkem Tuncay · in Torque Game Builder · 10/16/2006 (3:19 pm) · 12 replies

I am making my ever first game with Torque, I've posted once and ask about something else and I'm sure I'll ask more later because this community is great for your needs.

Anyways here is my question. I am making a simple pinball game, so left control key is for left peddle right control is for right peddle. But when you press both keys nothing happens. How can I define it to work when two keys pressed down together? Maybe easy but can't find through forum, help the newbie =)

I am using .bindCmd for normal key actions.

#1
10/16/2006 (6:28 pm)
That's just a matter of coding. How are you having the keys trigger the flippers?
#2
10/17/2006 (6:07 am)
As I said above, I use moveMap.bindCmd(keyboard,"key",downfunction(),Upfunction()); and functions leads to change angular velocity of flippers... Or I can't get your question =)
#3
10/17/2006 (8:34 am)
A peek at your code would probably be helpful. :) Just the relevant bits would suffice, I reckon, so the keybinds and related functions.
#4
10/17/2006 (4:00 pm)
I think I found the problem but I am curious how I can resolve that. Problem is about Left Control - Right Control keys. Whenever I change the keys as something else I can use them at same time. But I can't use left control and right control together as left shift and right shift. But hey this is a pinball game I can't bind any other key than these. So this is the code I use

moveMap.bindCmd(keyboard, "lshift","flipperhit();", "flippernormal();");
   moveMap.bindCmd(keyboard, "rshift","flipper_righthit();", "flipper_rightnormal();");

Functions works okay and nothing special with them they only change angular velocity, like I said if I change keys it works, but I need to use controls or shifts...
#5
10/21/2006 (2:44 pm)
No one?
#6
10/21/2006 (2:47 pm)
This is a hardware issue regarding the keys that you've selected for input.

In most (if not all) keyboards, the hardware uses a concept called scanlines to reduce the possible combinations of key inputs from a rather large number to a smaller one. Torque gets the keyboard input from the operating system, which gets it from the device driver, which gets it from the keyboard hardware itself, and in the case of the specific keys you've selected, the hardware, when both shift keys are pressed, defaults to one or the other because in most [/b]normal[/b] applications, having a shift-right and shift-left is merely a matter of convenience for typing speed.
#7
10/21/2006 (3:03 pm)
Then is there no way to fix it for now? At least by myself?
#8
10/21/2006 (6:52 pm)
Yes... Try using different keys than shift.
#9
10/21/2006 (6:56 pm)
It will be weird to play a pinball game without L-R Controls or L-R Shifts...Sigh...
#10
10/22/2006 (12:57 am)
Not everyone will have to make that sacrifice Goerkem - only users with the same style keyboard as you. Your specific hardware is limiting you from using these keys at the same time.
#11
10/25/2006 (12:37 pm)
Actually I had this problem on nearly any keyboard which is why I use z . for the flippers on MS own pinball game that comes with windows as well as with any other.
(and I should mention that I own only notebooks whichs keyboard normally outperform 80% of all desktop keyboards as they have a far better "connection" due to no number block and more data lines)
#12
10/25/2006 (10:52 pm)
Yes - many keyboards follow a standard configuration when it comes to the scan lines. There have been numerous studies done as to which keys users may hit at the same time during the course of typing and the scan lines are setup to eliminate any "non-reads" in a normal typing situation.

Unfortunately, only devices such as Logitech's G15 (which is awesome BTW - I own one) are configured with the gamers in mind when it comes to key presses.