DualShock 4 Controller Integration into "Stellarium Remote Control" Plugin #4785
Replies: 3 comments 5 replies
-
|
Can this be generalized to any kind of joysticks/gamepads? Particularly, so that the tab in the UI wasn't just dedicated to a particular model. |
Beta Was this translation helpful? Give feedback.
-
|
Whoa, that looks really interesting, thanks a lot! We had multiple requests for gamepad support. There was a gamepad module that would have had to be connected to MainController for Qt5 but not Qt6, so my motivation was limited. But this is a quite different approach. I have no physical game controller to test, but a little Bluetooth keyboard with gaming buttons which I at some time wanted to play with. A generalized solution (maybe with user-configurable key map?) would be great! It's maybe a bit late for 26.1 inclusion without testing (and we still have a few PRs to process!), but let's schedule this for 26.2. |
Beta Was this translation helpful? Give feedback.
-
|
Can you please create a pull request? As said, we should schedule it for 26.2. Sorry, I don't have time for thorough review for 26.1. (Or anyone else? If it does not disturb the other operation, we can have it in 26.1, including 1-2 pages of explanation in the User Guide. (If it's only PS4, maybe 1/2 page is enough, if users are open to configure their own gear by some form of text file (.ini, .json, ...), this must be explained.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🎮 DualShock 4 Controller Support for Stellarium Remote Control
Hello Stellarium community!
I'm excited to share a new enhancement I've been working on for the Remote Control plugin - full DualShock 4 (PS4) controller support with a dedicated tab in the web interface, customizable button mappings, and smooth analog control for Stellarium.
What Has Been Achieved
I've successfully integrated PlayStation 4 controller functionality directly into the existing Remote Control plugin's web interface. The implementation is built on the solid foundation created by Florian Schaukowitsch and Georg Zotti (ESA Summer of Code in Space 2015) and extends it with modern gamepad API support.
Key Features Implemented:
Right stick: continuous zoom control (push up/down)
🎮 Default Button Mapping (Intuitive Layout):
Technical Implementation Details
The integration is built using:
The code is structured as a new module (
ps4controller.js) that integrates seamlessly with the existing Remote Control plugin architecture. It uses the same action system (api/actions) and property system (api/properties) as the rest of the plugin.Future Development Ideas & Possibilities
While the current implementation focuses on DualShock 4, I believe there's tremendous potential for broader controller support. Here are some ideas I'd love to discuss with the community:
Short-term Enhancements:
Long-term Vision: Universal Game Controller Framework
I've been researching a promising project that could revolutionize how we handle game controllers in Stellarium: gamecontroller.js by Alvaro Montoro.
Why this is exciting:
This library provides a universal abstraction layer for game controllers that could:
Key advantages of integrating gamecontroller.js:
Proposed Integration Architecture:
Benefits of Universal Approach:
Discussion Questions for the Community:
What's your experience with game controllers in Stellarium? Have you tried using one before?
Which controllers would you like to see supported?
What features would make controller usage more appealing?
Should we pursue the universal approach via gamecontroller.js, or maintain individual controller modules?
Any astronomers here using Stellarium for outreach? Would a simple controller make demonstrations easier for the public?
Code & Testing
The current implementation is fully functional and ready for testing. I'd love feedback from anyone who:
To test:
Acknowledgments
This work builds upon the excellent foundation of the Remote Control plugin by Florian Schaukowitsch and Georg Zotti (ESA Summer of Code in Space 2015). Their clean architecture made this integration straightforward and maintainable.
I'm also grateful to the Stellarium team for creating such an amazing open-source planetarium that welcomes community contributions.
What are your thoughts? I'm particularly interested in hearing opinions on the universal controller framework idea versus maintaining individual controller support. Also, if anyone has experience with gamecontroller.js or similar libraries, your input would be invaluable!
Looking forward to a productive discussion!


P.S. - I've attached screenshots showing the new controller tab, customization interface, and live joystick preview. Let me know if you'd like to see them!
kutaiba akraa - Aleppo Syria
Beta Was this translation helpful? Give feedback.
All reactions