Game Development Community

InputMap Keyboard issues

by Ales Potocnik · in Torque X 2D · 07/15/2009 (1:34 am) · 2 replies

Hi,

is there a limit for keyboard press? The problem i am having is that when i have 2 simultaneous keys pressed (for instance for forward and left) and i want to press the third one (and i do) it is not doing anything. even bigger issue is with the MP split/shared screen if i want to set up two players both on keyboard if one is pressing 2 buttons the other is not getting any action at all? (but if one is not pressing anything the others controlls work correct)?
Or is this normal TX/XNA keyboard behaviour?

thanks in advance and greetings,

ales

#1
07/15/2009 (4:32 am)
I found this thread: http://www.garagegames.com/community/forums/viewthread/67153
i guess it is talking about the very same thing, i just wonder how others are handling then this (other games, there is a lot of games on 2 or more players on single keyboard).

thanks for suggestions
#2
07/15/2009 (11:54 am)
The problem here, as Tom points out in the referencedd thread is that most keyboards aren't designed for gaming -- they are designed for typing. When typing, most people aren't holding down multiple keys at the same time, so keyboard manufacturers take shortcuts and build masks in the wiring such that CERTAIN key combinations result in the same codes back (they mask each other). When the keys are individually pressed -- no problem -- but when several keys are pushed at the same time, the third key cannot be detected.

XNA is no different than any other keyboard handler for Windows (though the Xbox implementation might be different). So, if you can use key sets like iD, Valve, or Blizzard use for their games, you will be able to hold down as many keys as the keyboard can tolerate. I think the typical set up is two keys on each half of the keyboard simultaneously + ctrl, shift, and alt.