Atari VCS controllers are not supported in SDL2 out of the box. So using GamePadTool, I detect the joystick and create the string for adding the joy mapping to Godot. So far so good.

Input.add_joy_mapping("03000000503200000110000000000000,Classic Controller,a:b0,x:b1,back:b4,guide:b2,start:b3,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,platform:Windows,", true)

But in Godot, the special joystick/controller still does not respond. All other inputs and controllers work fine.

I used this post as a starting point. https://godotengine.org/qa/16367/how-does-input-add_joy_mapping-work

Any ideas?

Does the joystick come up if you run the joypad demo in the Godot demo repositories? If the controller can be found by Godot, I believe it should show up there and then you can see which inputs go to which.

I haven't tried adding joypad inputs manually though, so I'm not totally sure if the joypad demo will work or not. This page on the documentation about controllers and gamepads might also help.

Thanks for your help.

The joystick does not appear in the joypad demo in Godot.

But it does outside of Godot, and also is detected and works on https://gamepad-tester.com/ as mentioned in the Godot docs.

Well, if it's working on Gamepad Tester then that at least shows the controller should be accessible, it's just a matter of figuring out to interface with it. Unfortunately, I don't have very much experience with controller support in Godot, nor with the source code on how it works, so I'm unsure on what steps to take if mapping using Input.add_joy_mapping is not working.

What I would suggest doing is opening an issue on the Godot GitHub mentioning everything you've written here, and/or linking to this thread, as it sounds like something with the detection script might be the issue.

Thank you for your help and advice. Much appreciated.

Can you let me know exactly which controller this is? I can buy one and check it out, there should be a way. Also, what OS/system are you trying to use this on?

The target system is the Atari VCS. Tests are being made on Windows 10 and on the Linux based VCS Dev Kit. Same issues on both systems.

The controllers not recognized in Godot which also do not respond after manually adding the joy mapping strings are: - The Atari VCS Classic Joystick (wired and bluetooth) - The Atari VCS Modern Controller (wired and bluetooth)

I'm not sure were you are located, but if you're in NA, you could get the controllers here:

https://www.bestbuy.com/site/atari-vcs-wireless-classic-joystick/6459041.p?skuId=6459041

https://www.bestbuy.com/site/atari-vcs-wireless-modern-controller/6459042.p?skuId=6459042

Okay. I ordered them. I'll give it a shot when they come.

I got the controllers. I should have some time tomorrow to look into it.

Looking forward! Hope we can find a solution. :-)

Okay, @zapposh , so I started messing with it today. Good news is that the controller works with Godot out of the box. I only tested the modern controller, but it appears to mostly work (with a few issues), First I'll explain how I tested it. I'm running Ubuntu, and I installed the app "jstest-gtk". This showed me that the controller was connected and the OS was receiving input. Next I made a Godot project and had a single script with this code.

func _input(event):
   print(event.as_text())

This will print out any input events from the system that Godot can see. I saw that events were coming in from the controller, as well as their button/axis numbers.

Then I created a bunch of input maps for the various buttons and axis. One thing that was confusing was that the Atari controller was listed as Device 1, whereas the Xbox controller (and other ones I've tried) are always Device 0. I don't know if that is something with my system, or the fact that I have other controllers connected, but you have to watch out for this. You can also set the input map to All Devices, or possibly switch Device numbers dynamically, but for this test I just used Device 1. You can download the project here.

However, I found some problems. The face buttons (A, B, X, Y), both analog sticks, d-pad, and bumpers work perfectly. The triggers are weird. Instead of giving a value from 0 to 1, they are treated as 2 axis, one going from 0 to 1 and and the other 0 to -1 (and meeting halfway in the middle). I wrote some code to check for this and convert it into 0 - 1, but it's not perfect, and there is a big dead-zone in the middle. In addition, the back and options buttons are both registering as the A button. There is not much to do to fix this in Godot, as if you don't have a unique button number you can't know which was pressed. However, the event text does list "Back" so you can register back events (A still gets pressed) so that is okay. I could not get the options button to work at all (it just says A). However, depending on your game, maybe you can work with this.

One other thing. You can switch the controller into Xbox mode by holding both the Back and Options buttons for about 20 seconds. Once it is in Xbox mode, everything works perfect, all buttons, same as a real Xbox controller.

Also, I can't believe how good this controller is. It is at least 10 times better than the Microsoft Xbox controller. I played a bit of Cyberpunk 2077 with the Atari VCS gamepad and it was almost as good as playing with the mouse. The analog sticks are so smooth and responsive. You can also turn the camera just a little bit, really good controls. I'm so glad I decided to buy these, I will be playing with Atari from now on. Thanks.

Here is a project for the Atari VCS classic controller in Godot. I got the primary/secondary buttons, joystick directions and rotation working. The back/options/atari button are still messed up.

I figured out how to detect the Back and Atari buttons:

func _input(event):
	if event is InputEventKey and not event.is_pressed():
		if event.scancode == KEY_BACK:
			print("Button: Back")
		if event.scancode == KEY_HOMEPAGE:
			print("Button: Atari")

However, the primary button still gets pressed (before these register). And I can't seem to get the Menu button to work and I tried just about everything. But I know the controller is working cause I can see the events in the Ubuntu command line (using evtest). But jstest-gtk doesn't show anything and Godot just thinks it's the primary button.

Thanks so much for testing this out and sharing your results. I am checking out your files now, and see if I can get this to work.

Since the game is made for the VCS, Xbox mode is not an option, as both controllers need to work out of the box to pass cert.

Along those lines, I'll need to get the Atari button to exit to the Dashboard/AtariOS, and Menu or Back to Pause. Not sure if those activating the A button at the same time will be a problem. I'll try out different approaches.

I agree, the Atari controller is pretty good. The joystick too, it's something a little different for a change, and fun for simple arcade titles.

I have tested everything using your approach, and the situation is surely better now than what I had initially.

Since BACK and HOMEPAGE are called before Button A, it would be great to be able to cancel out A when triggered, but did not manage to do that yet. So basically the player starts jumping when pausing, and the jump continues when unpausing. No big deal, but not very clean.

Tried things like if event.scancode == KEY_BACK: Input.action_release("Jump")

but it seems to happen too late to cancel the input.

And I don't see either how to access the Menu/Options button unless it is fixed in Godot.

Another thing that does not seem to work with the two Atari controllers in AtariOS mode, is their vibration. Input.start_joy_vibration is ignored (but works in xbox mode).

7 months later

@cybereality said: I figured out how to detect the Back and Atari buttons:

func _input(event):
	if event is InputEventKey and not event.is_pressed():
		if event.scancode == KEY_BACK:
			print("Button: Back")
		if event.scancode == KEY_HOMEPAGE:
			print("Button: Atari")

However, the primary button still gets pressed (before these register). And I can't seem to get the Menu button to work and I tried just about everything. But I know the controller is working cause I can see the events in the Ubuntu command line (using evtest). But jstest-gtk doesn't show anything and Godot just thinks it's the primary button.

Hi,

Did you by any chance test the classic joystick in wireless mode too? All works as expected when plugged in via USB, but when in wireless mode, it seems that the spinner of the joystick is influencing the stick direction and causes issues. After days of trying I have not found a way to force ignoring the spinner.

    6 months later
    10 months later

    zapposh Hi, did you get the classic joystick working in Godot? I've been working on a VCS game but I couldn't get the classic controller working - I've been going round and round for months and nothing I've tried works.