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

Raspberry Pi: Keyboard recognized in Menu but not in Game #41

Open
Gemba opened this issue Mar 15, 2023 · 5 comments
Open

Raspberry Pi: Keyboard recognized in Menu but not in Game #41

Gemba opened this issue Mar 15, 2023 · 5 comments

Comments

@Gemba
Copy link

Gemba commented Mar 15, 2023

Describe the bug
On a Raspberry Pi the binary can be started and shows up the menu. In the menu navigation works with keyboard controls but after starting a new game the keyboard events are no longer recognized.

Allegro Lib
Tested with 4.4.3.1 (bundled with this repo) as well as with 4.4.2.1 from Raspi OS Buster.

To Reproduce
Steps to reproduce the behavior:

  1. Build this repo on Raspberry Pi
  2. Start headoverheels, navigate to new game
  3. Let game start
  4. Notice that no keyboard presses are recognized

Expected behavior
Keyboard should be usable in game.

Testsystem

  • OS: Raspi OS Buster (Debian 10)
  • Generic wired USB keyboard attached
  • Reproducable on Raspberry Pi 3 or Raspberry Pi 4

Additional context

PS: Thanks for reviving this classic game and gem.

@Gemba
Copy link
Author

Gemba commented Mar 15, 2023

Do you have hints/ideas how to track this down? Maybe it is also related to the allegro lib itself.

@Gemba
Copy link
Author

Gemba commented Apr 15, 2023

FWIW. As a workaround the allegro 5 build can be used. However, this limits the usage to the Raspberry Pi 4, as the Raspberry Pi 3 and the Head-over-Heels allegro5 binaries are not performing well together.

cf. https://gist.github.com/Gemba/f2c541f6e027d7278e948f80e311e318#file-headoverheels-sh-L46

@dougmencken
Copy link
Owner

dougmencken commented Oct 14, 2023

Such “the keyboard works in menus but not in the game” I am sometimes suffering (but sometimes not, it looks really random) when I run the game thru gdb (the debugger)

@dougmencken
Copy link
Owner

@Gemba I’m sure you’d like the 6dd444c patch

@dougmencken
Copy link
Owner

as for the issue with keyboard, that’s what I’ve got

keys are handled in two distinct threads, those which control the game and those which control the characters

so anything that treats threads unequally may broke the key handling

the good news are that since C++11 there’s std::thread
https://en.cppreference.com/w/cpp/thread/thread

does anyone want to try porting thread handling to std::thread, maybe?

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

2 participants