only usableManipulating the Input Manager in Script gives a solution for editor codes script:
/// <summary>
/// Gets all the input axis defined in the project's Input manager
/// (gets it from ProjectSettings/InputManager.asset)
/// </summary>
public static List<string> GetInputAxis()
{
var allAxis = new List<string>();
var serializedObject = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/InputManager.asset")[0]);
var axesProperty = serializedObject.FindProperty("m_Axes");
axesProperty.Next(true);
axesProperty.Next(true);
while (axesProperty.Next(false))
{
SerializedProperty axis = axesProperty.Copy();
axis.Next(true);
allAxis.Add(axis.stringValue);
}
return allAxis;
}
Unfortunately, this is only safe in the editor, and not while the game is running.