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

Author Topic: Weird movement shoot bug  (Read 1808 times)

0 Members and 1 Guest are viewing this topic.

Bizarreofnature

  • Newbie
  • *
  • Posts: 48
    • View Profile
Weird movement shoot bug
« on: October 28, 2017, 11:54:43 pm »
Hello!

And again I have to annoy you guys.
I got a very weird bug and I have NO idea.

Basically my ship can move in all directions and shooting at the same time is no problem, except for one direction. If i move my ship upwards and to the left at the same time, for some reason i cant shoot anymore.
It is only this direction, all the other 7 work fine. And the weird thing is my code is all clean. Just what is going on?

Thanks in advance,
Bizarreofnature!

Bizarreofnature

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Weird movement shoot bug
« Reply #1 on: October 29, 2017, 12:14:01 am »
Alright, I figured it. It was indeed an sfml bug. It seems sfml doesnt respond to certain keys when there are a few events at the same time.

Thanks anyways!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Weird movement shoot bug
« Reply #2 on: October 29, 2017, 12:30:20 am »
Sounds more like you have a cheap keyboard which causes "key jamming" very quickly. Not really anything SFML can do when your hardware is limiting the key inputs. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Weird movement shoot bug
« Reply #3 on: October 29, 2017, 12:33:34 am »
This is very common keyboard problem.

Not all keyboards' keys can be registered at once; certain combinations are impossible. Which combinations are valid or invalid depend on the keyboard. There exist some keyboards that have slightly better-than-standard independant recognition of keys, usually ones used commonly in games (qwerasdfzxcv... etc.)

This does mean, though, that it isn't an SFML bug as such; it's a keyboard technical error. For example, try the program with a different keyboard or you could try the exact same code replacing which keys are used and probably end up with a differing result.

You could also test this effect of your keyboard in a text editor. For example, if the keys you are using in your program are W for up, A for left and SPACE for shoot, try pressing those keys together in a simple text editor and see if the SPACE still works while W and A are still pressed...

Note: although eXpl0it3r posted first, I started mine first (was too long ;D) so I'm posting it anyway since it explains how you might test it or how to improve it by getting a new keyboard ;)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Bizarreofnature

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Weird movement shoot bug
« Reply #4 on: October 29, 2017, 12:38:39 am »
Wow you guys were right. It is indeed NOT an sfml bug.
Thanks for your answers!
« Last Edit: October 29, 2017, 12:41:11 am by Bizarreofnature »