Open AlexFolland opened 3 years ago
Hi @AlexFolland
bambam does try to grab the keyboard, but apparently this does not work completely in some environments. What you describe sounds like yet another case of what I described in the man page. Can you confirm that you are not running under Wayland? Would you mind pasting the output of env | sort
from you XFCE session (after pruning any sensitive information).
Here! Thanks for checking.
FWIW, I added a "bambam session" mode in v1.2.0 where you can install a .desktop
file which lets you run a session with just bambam in it. This way prevents this and any other ways to escape the program (as long as your other concurrent sessions are locked with a password).
FWIW, I added a "bambam session" mode in v1.2.0 where you can install a
.desktop
file which lets you run a session with just bambam in it. This way prevents this and any other ways to escape the program (as long as your other concurrent sessions are locked with a password).
This new addition is awesome, thanks @porridge!
Edit: mouse clicks are working in the dedication session, but mouse pointer does not show, and keyboard presses do not respond at all (quit does not work, no sound, no sprites are displayed).
@pdecat sorry, I only noticed your edit now. Can you please let me know what environment (hardware, distribution, display manager) you tried the dedicated session in? I did test it in a few display managers, and it worked without issues. 😞
Hi @porridge,
@pdecat sorry, I only noticed your edit now.
No problem :)
Can you please let me know what environment (hardware, distribution, display manager) you tried the dedicated session in?
It was probably with Xorg / AMD Radeon / Intel Core i7 on Ubuntu 22.04 (or maybe 22.10 beta).
I did test it in a few display managers, and it worked without issues. 😞
Let's consider this resolved then :)
Can you please let me know what environment (hardware, distribution, display manager) you tried the dedicated session in?
It was probably with Xorg / AMD Radeon / Intel Core i7 on Ubuntu 22.04 (or maybe 22.10 beta).
Thanks, and which display manager that was? Gdm, kdm, something else?
GDM3 most certainly.
Hm, I just tried it under gdm3 on current Debian stable, and:
quit
So there is something fishy going on...
Looks like GDM hides mouse cursor when starting a session, and pygame assumes it's on. But I was able to make it appear by flipping pygame.mouse.set_visible
back and forth. I'll make the change soon.
As for sound, it seems that we just need to wait a little for the sound service to be started by systemd. I'll see if I can do it in a reliable way, that avoids a race.
Although I didn't manage to reproduce it, I suspect the problem with non-working keyboard might be similar to the missing sound issue - if we initialize pygame too soon, "something" that makes keyboard work might not be running yet 🤔
Observed behavior:
My baby has successfully pressed the following XFCE shortcuts, which have inadvertently escaped this game:
These shortcuts are very easy to access, especially since they are both near the bottom of the keyboard, which is basically all my baby can reach from my chair.
Expected behavior:
Window manager keyboard shortcuts are expected to be disabled until the game is exited.
Alternatively, the program is expected to be able to be run directly from a TTY and start a display server like gamescope or something like that on its own, so that no window manager keyboard shortcuts are available.
Additional fluff:
Thanks for this FOSS. I have been looking for something like this, that allows my baby to just bash the keyboard and see what happens. My dad wrote a game in the 80s for DOS called "funkeys" for me and my brother to bash the keyboard way back then that drew random-colored and random-sized shapes on the screen, and played a random PC speaker tone with each keystroke, but he unfortunately lost the source code for that. Now that I have a kid, I wanted to give the same kind of introduction to computer keyboards.
~I wish there was sound in it. Even a random-pitch super short beep with each keystroke would be cool. Obviously no pressure though. It's FOSS, after all.~ Edit: Apparently I was experiencing an
easyeffects
+pipewire
issue that prevented all sound the first time I tried this program. Excuse me. There is sound!