Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Key recognition bug  (Read 4584 times)

0 Members and 1 Guest are viewing this topic.

n0_0ne

  • Newbie
  • *
  • Posts: 5
    • View Profile
Key recognition bug
« on: April 04, 2009, 10:28:36 am »
Hello,
I think I found a little bug in the sf::Input class.
In my project IsKeyDown(sf::Key::Space) works fine, only in combination with sf::Key::Left + sf::Key::Up pressed, it will always return false. I don't think that I am doing anything wrong. Perhaps someone else could test it.
If it's really a bug, I hope it will be fixed in the next release :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Key recognition bug
« Reply #1 on: April 04, 2009, 10:37:49 am »
This is probably a limitation of your keyboard (thus you would have it with any other library). Some combinations of 3 or more keys are usually not working, due to how keyboards are made internally. USB or gamers keyboards don't suffer from this issue.
Laurent Gomila - SFML developer

n0_0ne

  • Newbie
  • *
  • Posts: 5
    • View Profile
Key recognition bug
« Reply #2 on: April 04, 2009, 10:52:38 am »
Yeah, that was also my first thought... but it works for example with Up+Right+Space... and I think there isn't a big difference between Right and Left arrows in my keyboard... So I thought it must be a problem inside SFML.

Edit: I tested a bit more... it seems, that there really is a problem with Left+Up+Space, if you press two of them, the third key won't be recognized anymore... but if I press Down instead of Up, or Right instead of Left, everything is fine.  :?:

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Key recognition bug
« Reply #3 on: April 04, 2009, 11:26:56 am »
Try with the same computer, but another keyboard if you can.
SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Key recognition bug
« Reply #4 on: April 04, 2009, 11:30:08 am »
Quote
Yeah, that was also my first thought... but it works for example with Up+Right+Space... and I think there isn't a big difference between Right and Left arrows in my keyboard... So I thought it must be a problem inside SFML.

Actually, keyboards are made of a matrix. The combinations which don't work are those involving the same row or column twice. So there might be a big difference between right and left arrow :)
Laurent Gomila - SFML developer

n0_0ne

  • Newbie
  • *
  • Posts: 5
    • View Profile
Key recognition bug
« Reply #5 on: April 04, 2009, 11:34:15 am »
It's a laptop so I can't use another keyboard that easy ^^
But in case of this matrix... Left is in the same row as Space... but Right is too, and it works... Can nobody just test these three keys with a normal usb keyboard?

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Key recognition bug
« Reply #6 on: April 04, 2009, 11:49:32 am »
The matrix doesn't have to be like your keyboard layout. :)

Even with a laptop you can attach an USB keyboard.

Edit: Open a text editor and hit Left+Up+Space to test your keyboard.

n0_0ne

  • Newbie
  • *
  • Posts: 5
    • View Profile
Key recognition bug
« Reply #7 on: April 04, 2009, 11:59:46 am »
Ok I tested it again in a text editor... you were right, this error occurs there, too. I couldn't imagine and never realized, that my keyboard is that limited...

Sorry Laurent, that I doubted your incredible skillZ :D

K-Bal

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • pencilcase.bandcamp.com
    • Email
Key recognition bug
« Reply #8 on: April 04, 2009, 01:31:32 pm »
I have the same issue, I recognized it when I first wanted to play Tony Hawk on my Laptop ;) Just have to live with it.
Listen to my band: pencilcase.bandcamp.com

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Key recognition bug
« Reply #9 on: April 04, 2009, 08:09:29 pm »
In most games you can remap the key configuration. Mostly character keys can be pressed more than special function keys. I remember having that issue some years before. ;)

 

anything