Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Keyboard control problems  (Read 1242 times)

0 Members and 1 Guest are viewing this topic.
Keyboard control problems
« on: December 01, 2009, 02:15:19 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 446
I'm using an Acer netbook with Windows XP, but I've encountered this on other, better computers quite often.

This problem comes up when playing games with keyboard control schemes, and to start I'm going to use Super Mario RPG as an example (emulated, of course).

In SMRPG, there's 8-directional movement. Also, you can hold Y to run, and press B to jump. So if you want to move in a diagonal direction, that's two buttons pressed simultaneously; running makes it three buttons, and jumping makes it (briefly) four.

Now, this poses no problem on an actual controller or joypad. But when using controls mapped out onto a keyboard, Mario will simply refuse to jump when that fourth key is simultaneously pressed. Since even the Mario RPGs involve quite a bit of platforming, this can quickly become a gamestopper when the right situation comes along.

Now, that obviously isn't Nintendo's fault - they made their game to be played with a controller, not a keyboard. But since we here make games to be played on the keyboard, it starts to become less of an inconvenience and more of an actual problem. We want our players to be able to play properly.

In Game Maker, I'm using Goodnight's movement and I've added a sword. The sword is Z, the movement is arrows, so three keys total. But when Link is moving southeast, he can't swing the sword at the same time.

Now here's the odd thing - if I switch the sword to Space, the sword will work when moving southeast, but won't work when moving southwest. And if I change the sword to X, it won't work moving southeast or southwest.

What is the reason for this? Are some keys just incompatible with each other? Is it a memory problem, or maybe a problem with Windows?
Logged
Re: Keyboard control problems
« Reply #1 on: December 01, 2009, 08:09:21 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Most keyboards can't simultaneously handle signalling more than 3 keys at once. It's a technical limitation, not something that can really be bypassed.
Logged
Re: Keyboard control problems
« Reply #2 on: December 01, 2009, 09:15:25 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Besides, games built for use on computers rarely need more than 3 keys pressed at once. That's something far more common in consoles - which generally operate on a Bitwise system to detect gamepad input (see code listing for example, if you're curious). Keyboards often have too many buttons to do this, and instead send the data as a signal containing a keycode, which is interpreted by the operating system to determine which specific key it was (A, C, NumLock, etc), which then sends this data to any applications that are listening for keyboard input.

Code: [Select]
#define BUTTON_A 0x01
#define BUTTON_B 0x02
#define BUTTON_X 0x04
#define BUTTON_Y 0x08

...

// Check for input of A, B, and X buttons
if((this->_gamePad[0]->GetInput() & INPUT_A) && (this->_gamePad[0]->GetInput() & INPUT_B) && (this->_gamePad[0]->GetInput() & INPUT_X))
{
        // Do Something
}
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: Keyboard control problems
« Reply #3 on: December 04, 2009, 06:06:41 am »
  • AKA "Micah DS"
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1347
I'm using an Acer netbook with Windows XP, but I've encountered this on other, better computers quite often..... blah blah blah...

I also have an Acer but with Windows Vista (grrr) and I know exactly what you're talking about.

All I can say is it really sucks to play Cave Story, literally making hell total HELL and trying to get up there to get the spur is fricken annoying (but I still got it, yea 8)).

But yea, it's the stupid keyboard design, like Infini and MiNalien said.  :(
Logged
  • My Music

Antidote

>.>
Re: Keyboard control problems
« Reply #4 on: December 04, 2009, 06:23:45 am »
  • In all seriousness who's serious?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1485
yes, it's a limitation that is in the bios, it can only interpret 3 simultaneous keys, however the new standard is supposed to allow for up to 6 (double if you're keeping track) keys at once this should lighten up on this issue.
Logged
  • Axiomatic Data Laboratories
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.023 seconds with 48 queries.