Play Station / XBox Game Controller support.

APC

Member
Joined
Aug 8, 2017
Messages
45
Does any one know if there is a Module for Cerberus X that supports external game controllers like Play Station and XBox?
If not how can I start developing a Module to do that?
@MarkHart do you have some material that I can use? For instance Cerberus reads the DeviceHardware.

Your thoughts please.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
Sorry, how to detect hardware capabilities is not my expertise. I will see what GLFW has to offer and will report back.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
About GLFW which powers the desktop apps, here is the link to its documentation:


Certainy I could had some functionality to CX to expose some more informations.

If you want to give it a shot, the GLFW target and the mojo.input module and its native code counter parts should give you some hints if you want to give it a shot yourself.
 
Last edited:

APC

Member
Joined
Aug 8, 2017
Messages
45
About GLFW which powers the desktop apps, here is the link to its documentation:


Certainy I could had some functionality to CX to expose some more informations.

If you want to give it a shot, the GLFW target and the mojo.input module and its native code counter parts should give you some hints if you want to give it a shot yourself.
Mike thank you, I will give it a try. I want to do that for mobile devices too.
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
552
Did you look into this example? Accidently found this one:
examples\mojo\skn3\gamepad
 

APC

Member
Joined
Aug 8, 2017
Messages
45
Hello @Phil7, Thank you for spotting this.

I connected a PS4 game controller to my Mac Book Pro running MacOS Catalina 10.15.7 and to my HP Laptop running Windows 10 and it works like a charm on both. I connected via USB cable.
I also tested on mobile devices such as iOS and Android but it does not work on these devices.
I want to make it work on mobile devices.
The documentation does not state that it does not works on iOS and Android Devices.

Both iPhone X and Samsung Galaxy S7 allow the PS4 controller to connect via Bluetooth.

I wonder if anyone could help with me to get the iOS and Android devices to work.
 
Last edited:

Rob Hewitt

Active member
Tutorial Author
Joined
Aug 30, 2017
Messages
104
Afraid Android controller support is a bit hit and miss. My Bluetooth controllers worked great with my games on my s6 but don't work at all on my s9 and now s20. Also only partly worked on firestick. Even though they work fine on non Cerberus stuff.
 

APC

Member
Joined
Aug 8, 2017
Messages
45
Afraid Android controller support is a bit hit and miss. My Bluetooth controllers worked great with my games on my s6 but don't work at all on my s9 and now s20. Also only partly worked on firestick. Even though they work fine on non Cerberus stuff.
Thanks Rob. What I want to work is Cerberus X to read the Joy Pad .
 

APC

Member
Joined
Aug 8, 2017
Messages
45
Now I was able to connect the PS4 to my Mac Book via Bluetooth. and It works very well as it did with cable!
 

APC

Member
Joined
Aug 8, 2017
Messages
45
About GLFW which powers the desktop apps, here is the link to its documentation:


Certainy I could had some functionality to CX to expose some more informations.

If you want to give it a shot, the GLFW target and the mojo.input module and its native code counter parts should give you some hints if you want to give it a shot yourself.
Hello Mike and Phil7,
This time I compiled the examples/mojo/skn3/gamepad.cxs example as a DeskTop Game target on my Mac Book Pro. Like I reported before on the HTML5 target the PS4 and the XBox One controllers they work perfectly, was able to get both the Xbox One and PS4 controllers connected via Bluetooth. On the DeskTop Game target, the mapping of the buttons are not working properly on both controllers.
I will now start debugging to fix the mapping of the buttons. Looking at the the code this target uses the SDL implementation of the joystick, I should be able to identify the make and model to correct the buttons mapping.
The iOS and Android targets, have the virtual implementation of the joystick function calls but the controllers are not connecting to the gamepad app. I will try to get that done after I fix the GLFW/Desktop Game target.
I am not a programmer of your caliber but I am sure you can use my efforts to make it into the Cerberus release.
 
Last edited:

APC

Member
Joined
Aug 8, 2017
Messages
45
Hello @MikeHart , @Phil7 and the Cerberus X community, Happy New Year !
I am pleased to announce that I was able to get the PS Dual Shock 4 and Xbox One Wireless Controllers working on the Cerberus X!

I spend Christmas and New Year Holiday working on iOS and Android Target, the Android had an implementation but it was not working properly at least with these two BlueTooth controllers. My implementation identify the vendor and maps the buttons, joystick, triggers and DPAD correctly. I also implemented the GetJoyVendor and JoyBattLevel , for now they are available on iOS. The Android API is a bit more complicated them the iOS.
When I have a chance I will fix the Desktop target and perhaps add the vendor and battery level support, it will all depend on the GLFW .

Here is the list of the files I changes so you can verify, test and and to the next version of Cerberus. I believe this will be cool to support wireless game pad on iOS and Android devices.
Let me know were you want me to share the files I modified.

modules/mojo/input.cxs
modules/mojo/inputdevice.cxs
modules/brl/gametarget.cxs
modules/brl/native/gametarget.cpp
modules/brl/native/gametarget.java
targets/android/modules/native/android.java
targets/ios/template/CerberusGame.xcodeproj
targets/ios/template/main.h


Here you can watch a video of the iOS App Game Pad Test App
 

Attachments

  • 96D5F650-3921-4786-8568-693EA1DB6A76.png
    96D5F650-3921-4786-8568-693EA1DB6A76.png
    441.1 KB · Views: 14

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
Awesome. If you can, post a link to a GH repo of you so I can test it. If you don't have one, just post a link where I can download the files or attach them here.
 

APC

Member
Joined
Aug 8, 2017
Messages
45
Hello @MikeHart, below is the link to the github project for the changes I made to Cerberus that you requested. I believe I did not forget any file.
You will need the Pyro v1.01n module in order to run my test app, otherwise you can use the examples\mojo\skn3\gamepad.cxs. if you DM you email, I can do a wetransfer that module to you.
I am glad to contribute to Cerberus X .

Game Pad for iOS and Android
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
Sorry, had no time to look into this. Give me a few more days please.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,845
Hi APC,

sadly I get errors when compiling your additions on the GLFW target. BTW, I saw that you now check for XBOX or PS4 only, the generic solution that was in place is not called. What is the reasoning behind it? I suggest you upload a complete fork to your GH repo, not just changes. This way you might not forget something and I can compare changes more easily.
 
Top Bottom