Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event RawKeyUpEvent is never handled #379

Closed
mel-mouk opened this issue Feb 25, 2023 · 5 comments
Closed

Event RawKeyUpEvent is never handled #379

mel-mouk opened this issue Feb 25, 2023 · 5 comments

Comments

@mel-mouk
Copy link
Contributor

mel-mouk commented Feb 25, 2023

Hi,
The Joystick never triggers UP event from keyboard. (Bonfire 2.12.0).

After investigation, I noticed that keysPressed.isEmpty is always true for RawKeyUpEvent.
So in lib/joystick/joystick.dart line 160 the condition is true and we never reach the check for RawKeyUpEvent.

My understanding is that this condition is useful to trigger Idle when we stop moving. So I think the fix might be to refactor this to check if we're processing a directional event or an action before checking this.

But as I'm new to Bonfire I think I might lack some context.

I also noticed an issue when pressing multiple keys. I'm trying to run when pressing shift. If I press the directional keys first, it works. But if I press shift first, directional keys appear in keysPressed but is not the one in the event.logicalKeys which break the behavior.

@RafaelBarbosatec
Copy link
Owner

Hi @mel-mouk ! Thanks so much for contacting.
It’s a good point! I'll analyze a way to resolve this.

@mel-mouk
Copy link
Contributor Author

Thanks! Let me know if I can help, I love Bonfire and I plan to build on top of it so I would be happy to contribute if I can

@raLaaaa
Copy link

raLaaaa commented Apr 25, 2023

I also noticed an issue when pressing multiple keys. I'm trying to run when pressing shift. If I press the directional keys first, it works. But if I press shift first, directional keys appear in keysPressed but is not the one in the event.logicalKeys which break the behavior.

Can totally confirm this with left, right and space. This is also happening in the online demos.
Are there any news on this or can we contribute somehow? I think this is quite a big deal because it makes the keyboard controls feel pretty unresponsive?

You can reproduce this here:
https://bonfire-engine.github.io/examples/bonfire/#/

Keep pressing D for example,
Press space (while D is pressed),
Before the attack animation ends - quickly release D and press A - this will result the player further moving into the direction of D instead of turning around.

@RafaelBarbosatec
Copy link
Owner

RafaelBarbosatec commented Apr 26, 2023

In the version 2.12.3 I did some improvements! Take a look if it got better!
I hope that this can help you!

@raLaaaa
Copy link

raLaaaa commented Apr 27, 2023

@RafaelBarbosatec works like a charm for me!
Thank you for your awesome work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants