Closed TheConceptBoy closed 10 months ago
Hi @TheConceptBoy,
Thanks for filing an issue! Are you sure that code's supposed to work properly on a system without a window manager? Having had to dig into the depths of SDL's C code a number of times, I'm pretty sure SDL handles input events through its video subsystem which on Linux can be X11, Wayland, KMS/DRM, or a few more exotic ones. Since your system is running console-only, I don't believe SDL is able to capture the input events you're hoping it to. Has this been reported as working on similar console-only systems?
All the best,
Hi @TheConceptBoy,
Thanks for filing an issue! Are you sure that code's supposed to work properly on a system without a window manager? Having had to dig into the depths of SDL's C code a number of times, I'm pretty sure SDL handles input events through its video subsystem which on Linux can be X11, Wayland, KMS/DRM, or a few more exotic ones. Since your system is running console-only, I don't believe SDL is able to capture the input events you're hoping it to. Has this been reported as working on similar console-only systems?
All the best,
- Austin
I've seen people ask about it but I've never seen any tangible answers. If handling keyboard inputs through SDL is out of the question, what do you reckon is the next best option? I'm still using SDL to render the application.
If you're creating a window for rendering with SDL, then input capture should work. What are you rendering to with PySDL2 if you don't have a window manager?
If you're creating a window for rendering with SDL, then input capture should work. What are you rendering to with PySDL2 if you don't have a window manager?
You know what. I don't know what I was stressing about because I just installed wayland on this debian os using
sudo apt-get update
sudo apt-get install libwayland-dev
And then at the top of my python script, I used:
import os
os.putenv("SDL_VIDEODRIVER", "wayland")
And I am now receiving the keyboard event messages.
I thought this was going to be a lot more difficult
What are you rendering to with PySDL2 if you don't have a window manager?
It was Kiosk style application.
If you're creating a window for rendering with SDL, then input capture should work. What are you rendering to with PySDL2 if you don't have a window manager?
You know what. I don't know what I was stressing about because I just installed wayland on this debian os using
sudo apt-get update sudo apt-get install libwayland-dev
And then at the top of my python script, I used:
import os os.putenv("SDL_VIDEODRIVER", "wayland")
And I am now receiving the keyboard event messages.
I thought this was going to be a lot more difficult
Fantastic! Yeah, I understand the use-case now. Since SDL2 links X11 and Wayland dynamically (if neither are present it'll fall back to its dummy renderer), you still need to have the libraries installed to be able to create a full-screen window in a system without a desktop environment.
Good luck with the kiosk project!
The sample code, where, according to several other people, the input events should be processing:
Running on Debian minimum, on a Libre Potato AML s905X-CC computer.