[Extension] catch gamepad events

Hello!
Is it possible to write a gnome-shell extension that catches gamepads events?
Its seems to be possible in JavaScript…
Thank you

As far as I know, gamepads have key presses and releases just like keyboards, so it shouldn’t be any different.

You can look into the documentation for events like that, and I guess you probably want to connect on the global.stage object.

Gamepads are not handled by libinput and gnome-shell does not do anything with them either. As far as I know all native games open the device files directly via some library like SDL or the engine (like Unity for example) has some code to do that itself.

What might work from a shell extension is to try to use libmanette through introspection.

1 Like

Hello,
thanks for the answer. I managed to intercept this event via python edev.
Now my goal is to open the gnome overlay: I spent the whole day trying to understand how.
Apparently if I simulate the win+s keyboard via evdev gnome ignore this.
Is there any other way to open the overlay? maybe via dbus?
or maybe for my extention to intercept keypress?
Thanks

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.