Ghosting. It’s a hardware problem caused by “cheap” keyboards implementing
scan matrixes without diodes. This happens, in various variations, on all
keyboards, except for a few of the most extreme gaming keyboards.
Nothing much you can do about it, apart from allowing the user to pick keys
that happen to work on his/her keyboard. Arrow keys are usually safe, but you
can’t even bet on that.On Wednesday 07 December 2011, at 17.45.54, “richyelbag” <richard.simkins at gmail.com> wrote:
–
//David Olofson - Consultant, Developer, Artist, Open Source Advocate
I wanted to press A then D and W then S without letting go of the keys and have the sprite move correctly. But you’re right, it isn’t really necessary.
Try buying a cheap USB gamepad or a 360 controller. You might recommend
use of such in a game you make. Nobody will buy an NKRO keyboard when your
game is better with it, but gamepads are a little easier to come by and are
more widely useful.
Jonny DOn Wed, Dec 7, 2011 at 2:08 PM, richyelbag <richard.simkins at gmail.com>wrote:
**
Cheers SA,
The keyboard matrix is a useful bit of info.
@Torsten
I wanted to press A then D and W then S without letting go of the keys and
have the sprite move correctly. But you’re right, it isn’t really necessary.
Back then Archon, Barbarian, Sopwith and Star Control were my favourite
games, and StarCon came with DOS utility to check which keys can be
pressed at the same time and don’t block others.
When playing against someone else it was on the same keyboard, one would
use WASDQE, the other one the pad-keys(845679 or Insert/Delete).
I do remmember that certain IBM keyboards were able to get like 10-12
keys pressed at the same time and working fine…
Oh, I miss the days :)On 12/7/2011 8:45 AM, richyelbag wrote:
Hello,
If I have:
Code:
Uint8 *keystate = SDL_GetKeyState(0);
if (keystate[SDLK_w]) printf(“Up: Pressed.\n”);
else printf(“Up: released.\n”);
if (keystate[SDLK_s]) printf(“Down: Pressed.\n”);
else printf(“Down: released.\n”);
if (keystate[SDLK_a]) printf(“Left: Pressed.\n”);
else printf(“Left: released.\n”);
if (keystate[SDLK_d]) printf(“Right: Pressed.\n”);
else printf(“Right: released.\n”);
Back then Archon, Barbarian, Sopwith and Star Control were my favourite games, and StarCon
came with DOS utility to check which keys can be pressed at the same time and don’t block others.