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

Keyboard events are not reported when using GameWidget.controlled #1744

Closed
Hwan-seok opened this issue Jun 19, 2022 · 3 comments · Fixed by #1745
Closed

Keyboard events are not reported when using GameWidget.controlled #1744

Hwan-seok opened this issue Jun 19, 2022 · 3 comments · Fixed by #1745
Labels

Comments

@Hwan-seok
Copy link
Contributor

Current bug behaviour

As constructor GameWidget.controlled has no game, widget.game is null in the _handleKeyEvent.
As a result, no key events are reported.

KeyEventResult _handleKeyEvent(FocusNode focusNode, RawKeyEvent event) {
final game = widget.game;
if (game is KeyboardEvents) {
return game.onKeyEvent(event, RawKeyboard.instance.keysPressed);
}
return KeyEventResult.handled;
}

Expected behaviour

Report key events.

More environment information

  • Flame version: main

More information

Are you interested in working on a PR for this? YES

@spydon
Copy link
Member

spydon commented Jun 19, 2022

I think this might already be fixed in #1725, right @renancaraujo?

@Hwan-seok
Copy link
Contributor Author

I can carefully say that It seems a little different scope, doesn't it?

@spydon
Copy link
Member

spydon commented Jun 21, 2022

I can carefully say that It seems a little different scope, doesn't it?

Ah right, I confused things! :)

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

Successfully merging a pull request may close this issue.

2 participants