Questions Regarding Input. Controller Input.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Skydome

So I have a few questions regarding input.

Firstly, What is the difference between key and physical key?

And for controllers,
In the Devices section. That means what? Is that like if you have two Nintendo Switch controllers. One will be Device 0 and the other will be Device 1? And upto 8 Devices are supported?

So In the screenshot below. From number 23 onwards, they’re empty. So are they missing or that’s the limit to how many are supported.

How many controllers are supported? Playstation, Nintendo, xbox? And these companies have multiple consoles. From PS1 to 5.
Gamecube to Switch. Do they use similar ‘input signal’ over the different generations?

enter image description here

enter image description here

In the two screenshots above you can see the assigned keys appearing inside labels. I have stored the keys as string. And I display this in a label and a blank button sprite. The controls are customizable(Screenshot Below for what I mean) and whatever key is assigned shows up.

Now my worry is that when I store the gamepad control as string. It won’t be stored as A, B, L for the different buttons but as (DualShock Cross, XBox A, Nintendo B) for a single button. Which is very lengthy. Now of course I can use an if
statement and change it.
if event.as_text()=="DualShock Cross, XBox A, Nintendo B": InputScript.Attack_1 = "A"

But here the problem appears that these three controllers from different companies seem to be using the same ‘signal’ for very different inputs. Nintendo’s B is Xbox A. So how do I differentiate?
So in this code from above
event.as_text()==“DualShock Cross, XBox A, Nintendo B”:
// Device checking code.
InputScript.Attack_1 = “A”

I now need to find a way to determine which device is being used.

So if Device is Xbox then InputScript.Attack_1 = "A"
and if Device is Nintendo InputScript.Attack_1 = "B"

So that’s my last question how do I determine what kind of controller is being used?

:bust_in_silhouette: Reply From: USBashka

Input.get_joy_name(int device)

The method get_joy_name() isn’t declared in the current class. Is this not a built in method?

Skydome | 2022-07-12 19:15

Wait do I need to use Input.

OK that seems to be working. I will do more testing.

Skydome | 2022-07-12 19:31

Ok but I still need to know the Ids for the different joypads. Is there a list somewhere with device ID and name?

Skydome | 2022-07-12 19:33