I am working on a 2d side-scrolling pc game that uses SFML game library. The problem that I am not able to solve is that in many keyboards combination of three or more keys (like w + d + k) is not working. Is there any way to solve this issue?

  • 1
    \$\begingroup\$ I've never had a keyboard where W+D+K would result in a ghosting issue. Are you sure what you're seeing is ghosting and not a limited number of simultaneous inputs on your keyboard? \$\endgroup\$
    – Logarr
    Commented Sep 30, 2015 at 14:38
  • \$\begingroup\$ @Logarr "Ghosting" is the problem that some keyboard keys don't work when multiple keys are pressed simultaneously. The key presses that don't show up on the computer or seem to have disappeared are said to have been "ghosted". \$\endgroup\$ Commented Nov 24, 2015 at 11:12
  • \$\begingroup\$ @CeesTimmerman - I know exactly what ghosting is. What I'm saying is that since W+D+K do not form an intersection, I have never had a keyboard that was designed in a way that had that combination ghost. \$\endgroup\$
    – Logarr
    Commented Nov 24, 2015 at 15:03
  • \$\begingroup\$ @Logarr Then the limit would be in OP's software, not the keyboard or its driver. Also, not all keyboards are the same. \$\endgroup\$ Commented Nov 24, 2015 at 15:46

2 Answers 2


You can't. At least, not as a game developer.

As a gamer, you can purchase more expensive keyboards with "anti-ghosting" features, but otherwise the limitation is part of the hardware itself, so there's nothing you can do in software to solve it.

Check out this demo page to see how keyboard ghosting works, plus a demo: https://web.archive.org/web/20150429053827/http://www.microsoft.com/appliedsciences/antighostingexplained.mspx

So your best bets are:

  • Don't use a control scheme that requires too many simultaneous key presses
  • Use game pads if they are available
  • Let the player remap the keys so they can find a non-ghosting set of keys for their hardware
  • If you must, stick to the left side of the keyboard (around WASD) because keyboards tend to avoid ghosting around here

Historically, many PC games used modifier keys (Ctrl, Alt, Shift) as part of their controls because these keys were wired to handle being pressed together with other keys, to avoid ghosting. This practice sort of fell out of favour during the 90s because the modifier keys were being used more and more by the OS, which would interfere with the game.

Later, certain genres of games had their controls coalesce around key clusters, most notably the FPS genre around WASD + mouse, but another example would be Japanese indie games around ZXC + arrows. In a self-fulfilling manner, since most games used these clusters, keyboard manufacturers also made sure that ghosting was minimised around this area, so if you stick to the same controls that other popular games use, you will also avoid ghosting.

Looking at your example, W and D are fine but K is not; are you by any chance using K as a directional control? If so, consider using the arrow keys instead.

  • 2
    \$\begingroup\$ Your answer starts with "You can't", but then you give good advice on exactly how to avoid it. I think the right answer here is "pick control keys that don't have a ghosting issue on most keyboards". Good info here. \$\endgroup\$
    – JPhi1618
    Commented Sep 30, 2015 at 19:05
  • 2
    \$\begingroup\$ @JPhi1618 i think there's a difference between "here's how to avoid ghosting" and "here's how to deal with the fact that most keyboards have keyboards that ghost" \$\endgroup\$ Commented Sep 30, 2015 at 20:54

Buy a better keyboard.

Ghosting is caused by the hardware itself. Even many gaming keyboards will still have this problem; they only invest in fixing the problem for "common" keys like WASD (but not 'K' for instance).


  • 10
    \$\begingroup\$ ...and tell all your customers to also buy better keyboards? This doesn't sound like the most user-friendly solution. \$\endgroup\$
    – Philipp
    Commented Sep 30, 2015 at 10:02
  • \$\begingroup\$ Life is hard. Force your customers to buy better hardware or don't design games that are intrinsically broken on commodity keyboards. This ain't exactly rocket science. :) \$\endgroup\$ Commented Sep 30, 2015 at 21:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .