This code will only give the key string of the actual gamepad plugged in such as “A” for XBOX controller:
string keyTextstring = m_PlayerInput.actions[ActionName].GetBindingDisplayString(group: "Gamepad);
Is there a way to get the button names of a general gamepad like those in controller mapping? eg: Button South.
thank you!
I’m not sure if there is a better way but Binding.path will spit out a string like “/buttonSouth”.
You’d have to loop through the bindings:
foreach (var binding in m_PlayerInput.actions[ActionName].bindings)
{
Debug.Log(binding.path);
}
1 Like
Thank you! You’ve saved my day!
1 Like